<!DOCTYPE html><html lang="en"><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><meta name="generator" content="ReSpec 21.0.2"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><style>/* --- EXAMPLES --- */
div.example-title {
    min-width: 7.5em;
    color: #b9ab2d;
}
div.example-title span {
    text-transform: uppercase;
}
aside.example, div.example, div.illegal-example {
    padding: 0.5em;
    margin: 1em 0;
    position: relative;
    clear: both;
}
div.illegal-example { color: red }
div.illegal-example p { color: black }
aside.example, div.example {
    padding: .5em;
    border-left-width: .5em;
    border-left-style: solid;
    border-color: #e0cb52;
    background: #fcfaee;
}

aside.example div.example {
    border-left-width: .1em;
    border-color: #999;
    background: #fff;
}
aside.example div.example div.example-title {
    color: #999;
}
</style><style>/* --- ISSUES/NOTES --- */
div.issue-title, div.note-title , div.ednote-title, div.warning-title {
    padding-right:  1em;
    min-width: 7.5em;
    color: #b9ab2d;
}
div.issue-title { color: #e05252; }
div.note-title, div.ednote-title { color: #2b2; }
div.warning-title { color: #f22; }
div.issue-title span, div.note-title span, div.ednote-title span, div.warning-title span {
    text-transform: uppercase;
}
div.note, div.issue, div.ednote, div.warning {
    margin-top: 1em;
    margin-bottom: 1em;
}
.note > p:first-child, .ednote > p:first-child, .issue > p:first-child, .warning > p:first-child { margin-top: 0 }
.issue, .note, .ednote, .warning {
    padding: .5em;
    border-left-width: .5em;
    border-left-style: solid;
}
div.issue, div.note , div.ednote,  div.warning {
    padding: 1em 1.2em 0.5em;
    margin: 1em 0;
    position: relative;
    clear: both;
}
span.note, span.ednote, span.issue, span.warning { padding: .1em .5em .15em; }

.issue {
    border-color: #e05252;
    background: #fbe9e9;
}
.note, .ednote {
    border-color: #52e052;
    background: #e9fbe9;
}

.warning {
    border-color: #f11;
    border-width: .2em;
    border-style: solid;
    background: #fbe9e9;
}

.warning-title:before{
    content: "⚠"; /*U+26A0 WARNING SIGN*/
    font-size: 3em;
    float: left;
    height: 100%;
    padding-right: .3em;
    vertical-align: top;
    margin-top: -0.5em;
}

li.task-list-item {
    list-style: none;
}

input.task-list-item-checkbox {
    margin: 0 0.35em 0.25em -1.6em;
    vertical-align: middle;
}

.issue a.respec-gh-label {
  padding: 5px;
  margin: 0 2px 0 2px;
  font-size: 10px;
  text-transform: none;
  text-decoration: none;
  font-weight: bold;
  border-radius: 4px;
  position: relative;
  bottom: 2px;
}

.issue a.respec-label-dark {
  color: #fff;
  background-color: #000;
}

.issue a.respec-label-light {
  color: #000;
  background-color: #fff;
}
</style><style>/* --- WEB IDL --- */

pre.idl {
  padding: 1em;
}

.respec-idl-separator {
  padding: 0 0 0.4cm 0;
}

.respec-idl-separator:last-child {
  padding: 0;
}

@media print {
  pre.idl {
    white-space: pre-wrap;
  }
}

pre.idl::before {
  content: "WebIDL";
  display: block;
  width: 150px;
  background: #90b8de;
  color: #fff;
  font-family: sans-serif;
  font-weight: bold;
  margin: -1em 0 1em -1em;
  height: 28px;
  line-height: 28px;
}

.idlType {
  color: #ff4500;
  font-weight: bold;
  text-decoration: none;
}


/*.idlModule*/


/*.idlModuleID*/


/*.idlInterface*/

.idlInterfaceID,
.idlDictionaryID,
.idlCallbackID,
.idlEnumID {
  font-weight: bold;
  color: #005a9c;
}

a.idlEnumItem {
  color: #000;
  border-bottom: 1px dotted #ccc;
  text-decoration: none;
}

.idlSuperclass {
  font-style: italic;
  color: #005a9c;
}


/*.idlAttribute*/

.idlAttrType,
.idlFieldType,
.idlMemberType {
  color: #005a9c;
}

.idlAttrName,
.idlFieldName,
.idlMemberName {
  color: #ff4500;
}

.idlAttrName a,
.idlFieldName a,
.idlMemberName a {
  color: #ff4500;
  border-bottom: 1px dotted #ff4500;
  text-decoration: none;
}


/*.idlMethod*/

.idlMethType,
.idlCallbackType {
  color: #005a9c;
}

.idlMethName {
  color: #ff4500;
}

.idlMethName a {
  color: #ff4500;
  border-bottom: 1px dotted #ff4500;
  text-decoration: none;
}


/*.idlCtor*/

.idlCtorName {
  color: #ff4500;
}

.idlCtorName a {
  color: #ff4500;
  border-bottom: 1px dotted #ff4500;
  text-decoration: none;
}


/*.idlParam*/

.idlParamType {
  color: #005a9c;
}

.idlParamName,
.idlDefaultValue {
  font-style: italic;
}

.extAttr {
  color: #666;
}


/*.idlSectionComment*/

.idlSectionComment {
  color: gray;
}


/*.idlIterable*/

.idlIterableKeyType,
.idlIterableValueType {
  color: #005a9c;
}


/*.idlMaplike*/

.idlMaplikeKeyType,
.idlMaplikeValueType {
  color: #005a9c;
}


/*.idlConst*/

.idlConstType {
  color: #005a9c;
}

.idlConstName {
  color: #ff4500;
}

.idlConstName a {
  color: #ff4500;
  border-bottom: 1px dotted #ff4500;
  text-decoration: none;
}


/*.idlException*/

.idlExceptionID {
  font-weight: bold;
  color: #c00;
}

.idlTypedefID,
.idlTypedefType {
  color: #005a9c;
}

.idlRaises,
.idlRaises a.idlType,
.idlRaises a.idlType code,
.excName a,
.excName a code {
  color: #c00;
  font-weight: normal;
}

.excName a {
  font-family: monospace;
}

.idlRaises a.idlType,
.excName a.idlType {
  border-bottom: 1px dotted #c00;
}

.excGetSetTrue,
.excGetSetFalse,
.prmNullTrue,
.prmNullFalse,
.prmOptTrue,
.prmOptFalse {
  width: 45px;
  text-align: center;
}

.excGetSetTrue,
.prmNullTrue,
.prmOptTrue {
  color: #0c0;
}

.excGetSetFalse,
.prmNullFalse,
.prmOptFalse {
  color: #c00;
}

.idlImplements a, .idlIncludes a {
  font-weight: bold;
}

dl.attributes,
dl.methods,
dl.constants,
dl.constructors,
dl.fields,
dl.dictionary-members {
  margin-left: 2em;
}

.attributes dt,
.methods dt,
.constants dt,
.constructors dt,
.fields dt,
.dictionary-members dt {
  font-weight: normal;
}

.attributes dt code,
.methods dt code,
.constants dt code,
.constructors dt code,
.fields dt code,
.dictionary-members dt code {
  font-weight: bold;
  color: #000;
  font-family: monospace;
}

.attributes dt code,
.fields dt code,
.dictionary-members dt code {
  background: #ffffd2;
}

.attributes dt .idlAttrType code,
.fields dt .idlFieldType code,
.dictionary-members dt .idlMemberType code {
  color: #005a9c;
  background: transparent;
  font-family: inherit;
  font-weight: normal;
  font-style: italic;
}

.methods dt code {
  background: #d9e6f8;
}

.constants dt code {
  background: #ddffd2;
}

.constructors dt code {
  background: #cfc;
}

.attributes dd,
.methods dd,
.constants dd,
.constructors dd,
.fields dd,
.dictionary-members dd {
  margin-bottom: 1em;
}

table.parameters,
table.exceptions {
  border-spacing: 0;
  border-collapse: collapse;
  margin: 0.5em 0;
  width: 100%;
}

table.parameters {
  border-bottom: 1px solid #90b8de;
}

table.exceptions {
  border-bottom: 1px solid #deb890;
}

.parameters th,
.exceptions th {
  color: inherit;
  padding: 3px 5px;
  text-align: left;
  font-weight: normal;
}

.parameters th {
  color: #fff;
  background: #005a9c;
}

.exceptions th {
  background: #deb890;
}

.parameters td,
.exceptions td {
  padding: 3px 10px;
  border-top: 1px solid #ddd;
  vertical-align: top;
}

.parameters tr:first-child td,
.exceptions tr:first-child td {
  border-top: none;
}

.parameters td.prmName,
.exceptions td.excName,
.exceptions td.excCodeName {
  width: 100px;
}

.parameters td.prmType {
  width: 120px;
}

table.exceptions table {
  border-spacing: 0;
  border-collapse: collapse;
  width: 100%;
}

.respec-button-copy-paste:focus {
  text-decoration: none;
  border-color: #51a7e8;
  outline: none;
  box-shadow: 0 0 5px rgba(81, 167, 232, 0.5);
}

.respec-button-copy-paste:focus:hover,
.respec-button-copy-paste.selected:focus {
  border-color: #51a7e8;
}

.respec-button-copy-paste:hover,
.respec-button-copy-paste:active,
.respec-button-copy-paste.zeroclipboard-is-hover,
.respec-button-copy-paste.zeroclipboard-is-active {
  text-decoration: none;
  background-color: #ddd;
  background-image: linear-gradient(#eee, #ddd);
  border-color: #ccc;
}

.respec-button-copy-paste:active,
.respec-button-copy-paste.selected,
.respec-button-copy-paste.zeroclipboard-is-active {
  background-color: #dcdcdc;
  background-image: none;
  border-color: #b5b5b5;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15)
}

.respec-button-copy-paste.selected:hover {
  background-color: #cfcfcf;
}

.respec-button-copy-paste:disabled,
.respec-button-copy-paste:disabled:hover,
.respec-button-copy-paste.disabled,
.respec-button-copy-paste.disabled:hover {
  color: rgba(102, 102, 102, 0.5);
  cursor: default;
  background-color: rgba(229, 229, 229, 0.5);
  background-image: none;
  border-color: rgba(197, 197, 197, 0.5);
  box-shadow: none;
}
</style><style>/* --- PERMALINKS --- */

.permalink {
  width: 1px;
  height: 1px;
  overflow: visible;
  font-size: 10pt;
  font-style: normal;
  vertical-align: middle;
  margin-left: 4px;
}

.permalink a, .permalink a:link, .permalink a:visited, .permalink a:hover, .permalink a:focus, .permalink a:active {
  background:transparent !important;
  text-decoration:none;
  font-weight: bold;
  color:#666 !important;
}

.permalink abbr {
  border:0;
}
</style>
<title>JSON-LD 1.1 Framing</title>




<style type="text/css">
  div.example .highlight .hljs-string {
    font-weight: bold;
  }
  div.example .comment .hljs-string {
    color: #999;
    text-decoration: line-through;
  }
  .diff { font-weight:bold; color:#0a3; }
  .error a {
    color:  #ff4500;
    border-bottom:  1px dotted #ff4500;
    text-decoration: none;
  }
  .algorithm ol {
    counter-reset: numsection;
    list-style-type: none;
  }
  .algorithm li {
    margin: 0.5em 0;
  }
  .algorithm li:before {
    font-weight: bold;
    counter-increment: numsection;
    content: counters(numsection, ".") ") ";
  }
  .hl-bold {
    font-weight: bold;
    color: #0a3;
  }
  .comment {
    color: #999;
  }
  .changed {
    background-color: rgb(215, 238, 197);
  }
  .changed:hover {
    color:  green;
    background-color: inherit;
  }
</style>
<style id="respec-mainstyle">/*****************************************************************
 * ReSpec 3 CSS
 * Robin Berjon - http://berjon.com/
 *****************************************************************/

/* Override code highlighter background */
.hljs {
  background: transparent !important;
}

/* --- INLINES --- */
h1 abbr,
h2 abbr,
h3 abbr,
h4 abbr,
h5 abbr,
h6 abbr,
a abbr {
  border: none;
}

dfn {
  font-weight: bold;
}

a.internalDFN {
  color: inherit;
  border-bottom: 1px solid #99c;
  text-decoration: none;
}

a.externalDFN {
  color: inherit;
  border-bottom: 1px dotted #ccc;
  text-decoration: none;
}

a.bibref {
  text-decoration: none;
}

cite .bibref {
  font-style: normal;
}

code {
  color: #c83500;
}

th code {
  color: inherit;
}

/* --- TOC --- */

.toc a,
.tof a {
  text-decoration: none;
}

a .secno,
a .figno {
  color: #000;
}

ul.tof,
ol.tof {
  list-style: none outside none;
}

.caption {
  margin-top: 0.5em;
  font-style: italic;
}

/* --- TABLE --- */

table.simple {
  border-spacing: 0;
  border-collapse: collapse;
  border-bottom: 3px solid #005a9c;
}

.simple th {
  background: #005a9c;
  color: #fff;
  padding: 3px 5px;
  text-align: left;
}

.simple th[scope="row"] {
  background: inherit;
  color: inherit;
  border-top: 1px solid #ddd;
}

.simple td {
  padding: 3px 10px;
  border-top: 1px solid #ddd;
}

.simple tr:nth-child(even) {
  background: #f0f6ff;
}

/* --- DL --- */

.section dd > p:first-child {
  margin-top: 0;
}

.section dd > p:last-child {
  margin-bottom: 0;
}

.section dd {
  margin-bottom: 1em;
}

.section dl.attrs dd,
.section dl.eldef dd {
  margin-bottom: 0;
}

#issue-summary > ul,
.respec-dfn-list {
  column-count: 2;
}

#issue-summary li,
.respec-dfn-list li {
  list-style: none;
}

details.respec-tests-details {
  margin-left: 1em;
  display: inline-block;
  vertical-align: top;
}

details.respec-tests-details > * {
  padding-right: 2em;
}

details.respec-tests-details[open] {
  z-index: 999999;
  position: absolute;
  border: thin solid #cad3e2;
  border-radius: .3em;
  background-color: white;
  padding-bottom: .5em;
}

details.respec-tests-details[open] > summary {
  border-bottom: thin solid #cad3e2;
  padding-left: 1em;
  margin-bottom: 1em;
  line-height: 2em;
}

details.respec-tests-details > ul {
  width: 100%;
  margin-top: -0.3em;
}

details.respec-tests-details > li {
  padding-left: 1em;
}

@media print {
  .removeOnSave {
    display: none;
  }
}
</style><style>/*

github.com style (c) Vasily Polovnyov <vast@whiteants.net>

*/

.hljs {
  display: block;
  overflow-x: auto;
  padding: 0.5em;
  color: #333;
  background: #f8f8f8;
}

.hljs-comment,
.hljs-quote {
  color: #998;
  font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
  color: #333;
  font-weight: bold;
}

.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
  color: #008080;
}

.hljs-string,
.hljs-doctag {
  color: #d14;
}

.hljs-title,
.hljs-section,
.hljs-selector-id {
  color: #900;
  font-weight: bold;
}

.hljs-subst {
  font-weight: normal;
}

.hljs-type,
.hljs-class .hljs-title {
  color: #458;
  font-weight: bold;
}

.hljs-tag,
.hljs-name,
.hljs-attribute {
  color: #000080;
  font-weight: normal;
}

.hljs-regexp,
.hljs-link {
  color: #009926;
}

.hljs-symbol,
.hljs-bullet {
  color: #990073;
}

.hljs-built_in,
.hljs-builtin-name {
  color: #0086b3;
}

.hljs-meta {
  color: #999;
  font-weight: bold;
}

.hljs-deletion {
  background: #fdd;
}

.hljs-addition {
  background: #dfd;
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: bold;
}
</style><link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/2016/cg-final"><link rel="canonical" href="https://www.w3.org/TR/json-ld11cg-framing/"><script id="initialUserConfig" type="application/json">{
  "localBiblio": {
    "JSON-LD11CG": {
      "title": "JSON-LD 1.1",
      "href": "https://www.w3.org/2018/jsonld-cg-reports/json-ld/",
      "authors": [
        "Gregg Kellogg"
      ],
      "publisher": "W3C",
      "status": "CG Final"
    },
    "JSON-LD11CG-API": {
      "title": "JSON-LD 1.1 Processing Algorithms and API",
      "href": "https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/",
      "authors": [
        "Gregg Kellogg"
      ],
      "publisher": "W3C",
      "status": "CG Final"
    },
    "JSON-LD11CG-FRAMING": {
      "title": "JSON-LD 1.1 Framing",
      "href": "https://www.w3.org/2018/jsonld-cg-reports/json-ld-framing/",
      "authors": [
        "Gregg Kellogg"
      ],
      "publisher": "W3C",
      "status": "CG Final"
    },
    "JSON-LD-TESTS": {
      "title": "JSON-LD 1.1 Test Suite",
      "href": "https://json-ld.org/test-suite/",
      "authors": [
        "Gregg Kellogg"
      ],
      "publisher": "Linking Data in JSON Community Group"
    },
    "IEEE-754-2008": {
      "title": "IEEE 754-2008 Standard for Floating-Point Arithmetic",
      "href": "http://standards.ieee.org/findstds/standard/754-2008.html",
      "publisher": "Institute of Electrical and Electronics Engineers",
      "date": "2008"
    },
    "PROMISES": {
      "title": "Promise Objects",
      "href": "https://github.com/domenic/promises-unwrapping",
      "authors": [
        "Domenic Denicola"
      ],
      "status": "unofficial",
      "date": "January 2014"
    },
    "MICROFORMATS": {
      "title": "Microformats",
      "href": "http://microformats.org"
    }
  },
  "specStatus": "CG-FINAL",
  "copyrightStart": "2010",
  "shortName": "json-ld11cg-framing",
  "subtitle": "An Application Programming Interface for the JSON-LD Syntax",
  "prevVersion": "https://json-ld.org/spec/ED/json-ld-framing/20120830/",
  "previousPublishDate": "2012-08-30",
  "previousMaturity": "CG-DRAFT",
  "edDraftURI": "https://json-ld.org/spec/latest/json-ld-framing/",
  "testSuiteURI": "https://json-ld.org/test-suite/",
  "includePermalinks": true,
  "noRecTrack": true,
  "doJsonLd": true,
  "highlightVars": true,
  "postProcess": [
    null
  ],
  "editors": [
    {
      "name": "Gregg Kellogg",
      "url": "http://greggkellogg.net/",
      "company": "Spec-Ops",
      "companyURL": "https://spec-ops.io/",
      "w3cid": "44770"
    }
  ],
  "formerEditors": [
    {
      "name": "Manu Sporny",
      "url": "http://manu.sporny.org/",
      "company": "Digital Bazaar",
      "companyURL": "https://digitalbazaar.com/"
    },
    {
      "name": "Dave Longley",
      "url": "https://digitalbazaar.com/",
      "company": "Digital Bazaar",
      "companyURL": "https://digitalbazaar.com/"
    },
    {
      "name": "Markus Lanthaler",
      "url": "http://www.markus-lanthaler.com/",
      "company": "Graz University of Technology",
      "companyURL": "http://www.tugraz.at/"
    }
  ],
  "authors": [
    {
      "name": "Dave Longley",
      "url": "https://digitalbazaar.com/",
      "company": "Digital Bazaar",
      "companyURL": "https://digitalbazaar.com/",
      "note": "v1.0"
    },
    {
      "name": "Manu Sporny",
      "url": "http://manu.sporny.org/",
      "company": "Digital Bazaar",
      "companyURL": "https://digitalbazaar.com/",
      "note": "v1.0"
    },
    {
      "name": "Gregg Kellogg",
      "url": "http://greggkellogg.net/",
      "company": "Spec-Ops",
      "companyURL": "https://spec-ops.io/",
      "w3cid": "44770",
      "note": "v1.0 and v1.1"
    },
    {
      "name": "Markus Lanthaler",
      "url": "http://www.markus-lanthaler.com/",
      "company": "Graz University of Technology",
      "companyURL": "http://www.tugraz.at/",
      "note": "v1.0"
    },
    {
      "name": "Niklas Lindström",
      "url": "http://neverspace.net/",
      "note": "v1.0"
    }
  ],
  "github": "https://github.com/json-ld/json-ld.org/",
  "wg": "Linking Data in JSON Community Group",
  "wgURI": "https://json-ld.org/",
  "wgPublicList": "public-linked-json",
  "maxTocLevel": 4,
  "pubDate": "2016-06-07",
  "publishISODate": "2018-06-07T00:00:00.000Z",
  "generatedSubtitle": "Final Community Group Report 07 June 2018"
}</script><meta name="description" content="JSON-LD Framing allows developers to query by example and
  force a specific tree layout to a JSON-LD document."><script type="application/ld+json">{
  "@context": [
    "http://schema.org",
    {
      "@vocab": "http://schema.org/",
      "@language": "en",
      "w3p": "http://www.w3.org/2001/02pd/rec54#",
      "foaf": "http://xmlns.com/foaf/0.1/",
      "datePublished": {
        "@type": "http://www.w3.org/2001/XMLSchema#date"
      },
      "inLanguage": {
        "@language": null
      },
      "isBasedOn": {
        "@type": "@id"
      },
      "license": {
        "@type": "@id"
      }
    }
  ],
  "id": "https://www.w3.org/TR/json-ld11cg-framing/",
  "type": [
    "TechArticle"
  ],
  "name": "JSON-LD 1.1 Framing",
  "inLanguage": "en",
  "license": "https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document",
  "datePublished": "2018-06-07",
  "copyrightHolder": {
    "name": "World Wide Web Consortium",
    "url": "https://www.w3.org/"
  },
  "discussionUrl": "https://github.com/json-ld/json-ld.org/issues/",
  "alternativeHeadline": "An Application Programming Interface for the JSON-LD Syntax",
  "isBasedOn": "https://json-ld.org/spec/ED/json-ld-framing/20120830/",
  "description": "JSON-LD Framing allows developers to query by example and\n  force a specific tree layout to a JSON-LD document.",
  "editor": [
    {
      "type": "Person",
      "name": "Gregg Kellogg",
      "url": "http://greggkellogg.net/",
      "worksFor": {
        "name": "Spec-Ops",
        "url": "https://spec-ops.io/"
      }
    }
  ],
  "contributor": [
    {
      "type": "Person",
      "name": "Dave Longley",
      "url": "https://digitalbazaar.com/",
      "worksFor": {
        "name": "Digital Bazaar",
        "url": "https://digitalbazaar.com/"
      }
    },
    {
      "type": "Person",
      "name": "Manu Sporny",
      "url": "http://manu.sporny.org/",
      "worksFor": {
        "name": "Digital Bazaar",
        "url": "https://digitalbazaar.com/"
      }
    },
    {
      "type": "Person",
      "name": "Gregg Kellogg",
      "url": "http://greggkellogg.net/",
      "worksFor": {
        "name": "Spec-Ops",
        "url": "https://spec-ops.io/"
      }
    },
    {
      "type": "Person",
      "name": "Markus Lanthaler",
      "url": "http://www.markus-lanthaler.com/",
      "worksFor": {
        "name": "Graz University of Technology",
        "url": "http://www.tugraz.at/"
      }
    },
    {
      "type": "Person",
      "name": "Niklas Lindström",
      "url": "http://neverspace.net/"
    }
  ],
  "citation": [
    {
      "id": "https://tools.ietf.org/html/rfc7159",
      "type": "TechArticle",
      "name": "The JavaScript Object Notation (JSON) Data Interchange Format",
      "url": "https://tools.ietf.org/html/rfc7159"
    },
    {
      "id": "https://www.w3.org/2018/jsonld-cg-reports/json-ld/",
      "type": "TechArticle",
      "name": "JSON-LD 1.1",
      "url": "https://www.w3.org/2018/jsonld-cg-reports/json-ld/"
    },
    {
      "id": "https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/",
      "type": "TechArticle",
      "name": "JSON-LD 1.1 Processing Algorithms and API",
      "url": "https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/"
    },
    {
      "id": "https://heycam.github.io/webidl/",
      "type": "TechArticle",
      "name": "Web IDL",
      "url": "https://heycam.github.io/webidl/"
    },
    {
      "id": "https://www.w3.org/TR/rdf-concepts/",
      "type": "TechArticle",
      "name": "Resource Description Framework (RDF): Concepts and Abstract Syntax",
      "url": "https://www.w3.org/TR/rdf-concepts/"
    },
    {
      "id": "https://tools.ietf.org/html/rfc3987",
      "type": "TechArticle",
      "name": "Internationalized Resource Identifiers (IRIs)",
      "url": "https://tools.ietf.org/html/rfc3987"
    },
    {
      "id": "https://tools.ietf.org/html/bcp47",
      "type": "TechArticle",
      "name": "Tags for Identifying Languages",
      "url": "https://tools.ietf.org/html/bcp47"
    },
    {
      "id": "https://www.w3.org/TR/json-ld/",
      "type": "TechArticle",
      "name": "JSON-LD 1.0",
      "url": "https://www.w3.org/TR/json-ld/"
    },
    {
      "id": "https://tools.ietf.org/html/rfc2119",
      "type": "TechArticle",
      "name": "Key words for use in RFCs to Indicate Requirement Levels",
      "url": "https://tools.ietf.org/html/rfc2119"
    },
    {
      "id": "https://json-ld.org/test-suite/",
      "type": "TechArticle",
      "name": "JSON-LD 1.1 Test Suite",
      "url": "https://json-ld.org/test-suite/"
    },
    {
      "id": "http://www.ecma-international.org/ecma-262/6.0/index.html",
      "type": "TechArticle",
      "name": "ECMA-262 6th Edition, The ECMAScript 2015 Language Specification",
      "url": "http://www.ecma-international.org/ecma-262/6.0/index.html"
    },
    {
      "id": "https://www.w3.org/TR/rdf11-concepts/",
      "type": "TechArticle",
      "name": "RDF 1.1 Concepts and Abstract Syntax",
      "url": "https://www.w3.org/TR/rdf11-concepts/"
    },
    {
      "id": "https://www.w3.org/TR/rdf-schema/",
      "type": "TechArticle",
      "name": "RDF Schema 1.1",
      "url": "https://www.w3.org/TR/rdf-schema/"
    },
    {
      "id": "https://www.w3.org/2018/jsonld-cg-reports/json-ld-framing/",
      "type": "TechArticle",
      "name": "JSON-LD 1.1 Framing",
      "url": "https://www.w3.org/2018/jsonld-cg-reports/json-ld-framing/"
    }
  ]
}</script></head>

<body class="h-entry"><div class="head">
  <a href="https://www.w3.org/" class="logo">
      <img alt="W3C" width="72" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C">
  </a>
  <h1 class="title p-name" id="title">JSON-LD 1.1 Framing</h1>
  <h2 id="subtitle">An Application Programming Interface for the JSON-LD Syntax</h2>
  <h2 id="final-community-group-report-07-june-2018">Final Community Group Report <time class="dt-published" datetime="2018-06-07">07 June 2018</time></h2>
  <dl>


    <dt>Latest editor's draft:</dt><dd><a href="https://json-ld.org/spec/latest/json-ld-framing/">https://json-ld.org/spec/latest/json-ld-framing/</a></dd>
    <dt>Test suite:</dt><dd><a href="https://json-ld.org/test-suite/">https://json-ld.org/test-suite/</a></dd>


    <dt>Previous version:</dt><dd><a href="https://json-ld.org/spec/ED/json-ld-framing/20120830/">https://json-ld.org/spec/ED/json-ld-framing/20120830/</a></dd>

    <dt>Editor:</dt>
    <dd class="p-author h-card vcard" data-editor-id="44770"><a class="u-url url p-name fn" href="http://greggkellogg.net/">Gregg Kellogg</a> (<a class="p-org org h-org h-card" href="https://spec-ops.io/">Spec-Ops</a>)</dd>
    <dt>Former editors:</dt><dd class="p-author h-card vcard"><a class="u-url url p-name fn" href="http://manu.sporny.org/">Manu Sporny</a> (<a class="p-org org h-org h-card" href="https://digitalbazaar.com/">Digital Bazaar</a>)</dd><dd class="p-author h-card vcard"><a class="u-url url p-name fn" href="https://digitalbazaar.com/">Dave Longley</a> (<a class="p-org org h-org h-card" href="https://digitalbazaar.com/">Digital Bazaar</a>)</dd><dd class="p-author h-card vcard"><a class="u-url url p-name fn" href="http://www.markus-lanthaler.com/">Markus Lanthaler</a> (<a class="p-org org h-org h-card" href="http://www.tugraz.at/">Graz University of Technology</a>)</dd>
    <dt>Authors:</dt><dd class="p-author h-card vcard"><a class="u-url url p-name fn" href="https://digitalbazaar.com/">Dave Longley</a> (<a class="p-org org h-org h-card" href="https://digitalbazaar.com/">Digital Bazaar</a>) (v1.0)</dd><dd class="p-author h-card vcard"><a class="u-url url p-name fn" href="http://manu.sporny.org/">Manu Sporny</a> (<a class="p-org org h-org h-card" href="https://digitalbazaar.com/">Digital Bazaar</a>) (v1.0)</dd><dd class="p-author h-card vcard" data-editor-id="44770"><a class="u-url url p-name fn" href="http://greggkellogg.net/">Gregg Kellogg</a> (<a class="p-org org h-org h-card" href="https://spec-ops.io/">Spec-Ops</a>) (v1.0 and v1.1)</dd><dd class="p-author h-card vcard"><a class="u-url url p-name fn" href="http://www.markus-lanthaler.com/">Markus Lanthaler</a> (<a class="p-org org h-org h-card" href="http://www.tugraz.at/">Graz University of Technology</a>) (v1.0)</dd><dd class="p-author h-card vcard"><a class="u-url url p-name fn" href="http://neverspace.net/">Niklas Lindström</a> (v1.0)</dd>
    <dt>Participate:</dt><dd>
      <a href="https://github.com/json-ld/json-ld.org/">GitHub json-ld/json-ld.org</a>
    </dd><dd>
      <a href="https://github.com/json-ld/json-ld.org/issues/">File a bug</a>
    </dd><dd>
      <a href="https://github.com/json-ld/json-ld.org/commits/gh-pages">Commit history</a>
    </dd><dd>
      <a href="https://github.com/json-ld/json-ld.org/pulls/">Pull requests</a>
    </dd>
  </dl>

  <p class="copyright">
    <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> ©
    2010-2018
    the Contributors to the JSON-LD 1.1 Framing Specification, published by the
    <a href="https://json-ld.org/">Linking Data in JSON Community Group</a> under the
    <a href="https://www.w3.org/community/about/agreements/fsa/">W3C Community Final Specification Agreement (FSA)</a>.
      A human-readable <a href="https://www.w3.org/community/about/agreements/fsa-deed/">summary</a> is available.

  </p>
  <hr title="Separator for header">
</div>
<section id="abstract" class="introductory"><h2 id="abstract-0">Abstract</h2>
<p>JSON-LD Framing allows developers to query by example and
  force a specific tree layout to a JSON-LD document.</p>
</section>

<section id="sotd" class="introductory"><h2 id="status-of-this-document">Status of This Document</h2><p>
  This specification was published by the <a href="https://json-ld.org/">Linking Data in JSON Community Group</a>.
  It is not a W3C Standard nor is it on the W3C Standards Track.

    Please note that under the
    <a href="https://www.w3.org/community/about/agreements/final/">W3C Community Final Specification Agreement (FSA)</a>
    other conditions apply.

  Learn more about
  <a href="https://www.w3.org/community/">W3C Community and Business Groups</a>.
</p><p>This document has been developed by the
    <a href="https://www.w3.org/community/json-ld/">JSON for Linking Data W3C Community Group</a>.
    The specification has undergone
    significant development, review, and changes during the course of several years.</p><p>There are several independent
    <a href="https://json-ld.org/test-suite/reports/">interoperable implementations</a> of
    this specification, a test suite [<cite><a class="bibref" href="#bib-JSON-LD-TESTS">JSON-LD-TESTS</a></cite>] and a
    <a href="https://json-ld.org/playground/">live JSON-LD playground</a> that is capable
    of demonstrating the features described in this document.</p><p>If you wish to make comments regarding this document, please send them to
    <a href="mailto:public-linked-json@w3.org">public-linked-json@w3.org</a>
    (<a href="mailto:public-linked-json-request@w3.org?subject=subscribe">subscribe</a>,
    <a href="https://lists.w3.org/Archives/Public/public-linked-json/">archives</a>).</p><section>
    <h3 id="set-of-documents">Set of Documents</h3>
    <p>This document is one of three JSON-LD 1.1 Recommendations produced by the
      <a href="https://www.w3.org/community/json-ld/">JSON for Linking Data W3C Community Group</a>:</p>

    <ul>
      <li><a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld/">JSON-LD 1.1</a></li>
      <li><a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/">JSON-LD 1.1 Processing Algorithms and API</a></li>
      <li><a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-framing/https://www.w3.org/2018/jsonld-cg-reports/json-ld-framing/">JSON-LD 1.1 Framing</a></li>
    </ul>
  </section></section><nav id="toc"><h2 class="introductory" id="table-of-contents">Table of Contents</h2><ol class="toc"><li class="tocline"><a href="#introduction" class="tocxref"><span class="secno">1. </span>Introduction</a><ol class="toc"><li class="tocline"><a href="#how-to-read-this-document" class="tocxref"><span class="secno">1.1 </span>How to Read this Document</a></li><li class="tocline"><a href="#contributing" class="tocxref"><span class="secno">1.2 </span>Contributing</a></li><li class="tocline"><a href="#terminology" class="tocxref"><span class="secno">1.3 </span>Terminology</a><ol class="toc"><li class="tocline"><a href="#algorithm-terms" class="tocxref"><span class="secno">1.3.1 </span>Algorithm Terms</a></li></ol></li><li class="tocline"><a href="#typographical-conventions" class="tocxref"><span class="secno">1.4 </span>Typographical conventions</a></li></ol></li><li class="tocline"><a href="#features" class="tocxref"><span class="secno">2. </span>Features</a><ol class="toc"><li class="tocline"><a href="#framing" class="tocxref"><span class="secno">2.1 </span>Framing</a></li><li class="tocline"><a href="#default-content" class="tocxref"><span class="secno">2.2 </span>Default content</a></li><li class="tocline"><a href="#framing-flags" class="tocxref"><span class="secno">2.3 </span>Framing Flags</a><ol class="toc"><li class="tocline"><a href="#object-embed-flag" class="tocxref"><span class="secno">2.3.1 </span>Object Embed Flag</a></li><li class="tocline"><a href="#explicit-inclusion-flag" class="tocxref"><span class="secno">2.3.2 </span>Explicit inclusion flag</a></li><li class="tocline"><a href="#omit-default-flag" class="tocxref"><span class="secno">2.3.3 </span>Omit default flag</a></li><li class="tocline"><a href="#omit-graph-flag" class="tocxref"><span class="secno">2.3.4 </span>Omit graph flag</a></li><li class="tocline"><a href="#require-all-flag" class="tocxref"><span class="secno">2.3.5 </span>Require all flag</a></li></ol></li><li class="tocline"><a href="#reverse-framing" class="tocxref"><span class="secno">2.4 </span>Reverse Framing</a></li><li class="tocline"><a href="#framing-named-graphs" class="tocxref"><span class="secno">2.5 </span>Framing Named Graphs</a></li></ol></li><li class="tocline"><a href="#conformance" class="tocxref"><span class="secno">3. </span>Conformance</a></li><li class="tocline"><a href="#framing-algorithms" class="tocxref"><span class="secno">4. </span>Framing Algorithms</a><ol class="toc"><li class="tocline"><a href="#framing-keywords" class="tocxref"><span class="secno">4.1 </span>Syntax Tokens and Keywords</a></li><li class="tocline"><a href="#framing-0" class="tocxref"><span class="secno">4.2 </span>Framing</a><ol class="toc"><li class="tocline"><a href="#framing-requirements" class="tocxref"><span class="secno">4.2.1 </span>Framing Requirements</a></li><li class="tocline"><a href="#framing-algorithm" class="tocxref"><span class="secno">4.2.2 </span>Framing Algorithm</a></li><li class="tocline"><a href="#frame-matching" class="tocxref"><span class="secno">4.2.3 </span>Frame Matching Algorithm</a></li><li class="tocline"><a href="#value-matching" class="tocxref"><span class="secno">4.2.4 </span>Value Pattern Matching Algorithm</a></li></ol></li></ol></li><li class="tocline"><a href="#the-application-programming-interface" class="tocxref"><span class="secno">5. </span>The Application Programming Interface</a><ol class="toc"><li class="tocline"><a href="#jsonldprocessor" class="tocxref"><span class="secno">5.1 </span>JsonLdProcessor</a></li><li class="tocline"><a href="#error-handling" class="tocxref"><span class="secno">5.2 </span>Error Handling</a></li><li class="tocline"><a href="#data-structures" class="tocxref"><span class="secno">5.3 </span>Data Structures</a><ol class="toc"><li class="tocline"><a href="#jsonldcontext" class="tocxref"><span class="secno">5.3.1 </span>JsonLdContext</a></li><li class="tocline"><a href="#jsonldoptions" class="tocxref"><span class="secno">5.3.2 </span>JsonLdOptions</a></li></ol></li></ol></li><li class="tocline"><a href="#iana-considerations" class="tocxref"><span class="secno">A. </span>IANA Considerations</a></li><li class="tocline"><a href="#security" class="tocxref"><span class="secno">B. </span>Security Considerations</a></li><li class="tocline"><a href="#idl-index" class="tocxref"><span class="secno">C. </span>IDL Index</a></li><li class="tocline"><a href="#changes-since-1-0-draft-of-30-august-2012" class="tocxref"><span class="secno">D. </span>Changes since 1.0 Draft of 30 August 2012</a></li><li class="tocline"><a href="#open-issues" class="tocxref"><span class="secno">E. </span>Open Issues</a></li><li class="tocline"><a href="#acknowledgements" class="tocxref"><span class="secno">F. </span>Acknowledgements</a></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">G. </span>References</a><ol class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">G.1 </span>Normative references</a></li><li class="tocline"><a href="#informative-references" class="tocxref"><span class="secno">G.2 </span>Informative references</a></li></ol></li></ol></nav>

<section id="introduction">
<!--OddPage--><h2 id="x1-introduction"><span class="secno">1. </span>Introduction&nbsp;<span class="permalink"><a href="#introduction" aria-label="Permalink for 1. Introduction" title="Permalink for 1. Introduction"><span>§</span></a></span></h2>
<p>A JSON-LD document is a representation of a directed graph. A single
  directed graph can have many different serializations, each expressing
  exactly the same information. Developers typically work with trees, represented as
  <a href="#dfn-json-objects" class="internalDFN" data-link-type="dfn">JSON objects</a>. While mapping a graph to
  a tree can be done, the layout of the end result must be specified in advance.
  A <a href="#dfn-json-ld-frame" class="internalDFN" data-link-type="dfn">Frame</a> can be used by a developer on a JSON-LD document to
  specify a deterministic layout for a graph.</p>

<section id="how-to-read-this-document">
<h3 id="x1-1-how-to-read-this-document"><span class="secno">1.1 </span>How to Read this Document&nbsp;<span class="permalink"><a href="#how-to-read-this-document" aria-label="Permalink for 1.1 How to Read this Document" title="Permalink for 1.1 How to Read this Document"><span>§</span></a></span></h3>

<p>
This document is a detailed specification for a serialization of Linked
Data in JSON. The document is primarily intended for the following audiences:
</p>

<ul>
  <li>Authors who want to query JSON-LD documents to create representations
    more appropriate for a given use case.</li>
  <li>Software developers that want to implement <a href="#dfn-json-ld-processors" class="internalDFN" data-link-type="dfn">processors</a> and APIs for
  JSON-LD.</li>
</ul>

<p>
To understand the basics in this specification you must first be familiar with
<a href="https://tools.ietf.org/html/rfc7159">JSON</a>, which is detailed in [<cite><a class="bibref" href="#bib-RFC7159">RFC7159</a></cite>]. You must also understand the
JSON-LD 1.1 Syntax specification [<cite><a class="bibref" href="#bib-JSON-LD11CG">JSON-LD11CG</a></cite>], which is the base syntax used by all of the
algorithms in this document,
and the JSON-LD 1.1 API [<cite><a class="bibref" href="#bib-JSON-LD11CG-API">JSON-LD11CG-API</a></cite>]. To understand the API and how it is
intended to operate  in a programming environment, it is useful to have working
knowledge of the JavaScript programming language [<cite><a class="bibref" href="#bib-ECMASCRIPT-6.0">ECMASCRIPT-6.0</a></cite>] and
WebIDL [<cite><a class="bibref" href="#bib-WEBIDL">WEBIDL</a></cite>]. To understand how JSON-LD maps to RDF, it is helpful to be
familiar with the basic RDF concepts [<cite><a class="bibref" href="#bib-RDF-CONCEPTS">RDF-CONCEPTS</a></cite>].</p>

</section>

<section id="contributing">
  <h3 id="x1-2-contributing"><span class="secno">1.2 </span>Contributing&nbsp;<span class="permalink"><a href="#contributing" aria-label="Permalink for 1.2 Contributing" title="Permalink for 1.2 Contributing"><span>§</span></a></span></h3>

  <p>There are a number of ways that one may participate in the development of
    this specification:</p>

  <ul>
    <li>Technical discussion typically occurs on the public mailing list:
      <a href="https://lists.w3.org/Archives/Public/public-linked-json/">public-linked-json@w3.org</a></li>

    <!--<li><a href="https://json-ld.org/minutes/">Public teleconferences</a> are held
      on Tuesdays at 1500UTC on the second and fourth week of each month.</li> -->

    <li>The <a href="https://webchat.freenode.net/?channels=json-ld">#json-ld</a>
      IRC channel is available for real-time discussion on irc.freenode.net.</li>
  </ul>

</section>

<section id="terminology">
    <h3 id="x1-3-terminology"><span class="secno">1.3 </span>Terminology&nbsp;<span class="permalink"><a href="#terminology" aria-label="Permalink for 1.3 Terminology" title="Permalink for 1.3 Terminology"><span>§</span></a></span></h3>

    <p>This document uses the following terms as defined in JSON [<cite><a class="bibref" href="#bib-RFC7159">RFC7159</a></cite>]. Refer
      to the <a href="https://tools.ietf.org/html/rfc7159#section-2">JSON Grammar section</a> in [<cite><a class="bibref" href="#bib-RFC7159">RFC7159</a></cite>] for formal definitions.</p>

    <div data-oninclude="restrictReferences"><dl class="termlist" data-sort="" id="terms"><dt><dfn data-lt="arrays|array" id="dfn-arrays" data-dfn-type="dfn">array</dfn></dt><dd>
    In the JSON serialization, an array structure is represented as square brackets surrounding zero
    or more values. Values are separated by commas.
    In the <a href="#dfn-internal-representation" class="internalDFN" data-link-type="dfn">internal representation</a>, an array is an <em>ordered</em> collection of zero or more values.
    While JSON-LD uses the same array representation as JSON,
    the collection is <em>unordered</em> by default. While order is
    preserved in regular JSON arrays, it is not in regular JSON-LD arrays
    unless specifically defined (see
    <a class="externalDFN" href="https://www.w3.org/2018/jsonld-cg-reports/json-ld/#sets-and-lists">Sets and Lists</a> in
    the JSON-LD Syntax specification [<cite><a class="bibref" href="#bib-JSON-LD11CG">JSON-LD11CG</a></cite>]).</dd>
  <dt><dfn data-lt="json objects|json object" id="dfn-json-objects" data-dfn-type="dfn">JSON object</dfn></dt><dd>
    In the JSON serialization, an <a class="externalDFN" href="https://tools.ietf.org/html/rfc7159#section-4">object</a> structure is represented as a pair of curly brackets surrounding zero or
    more key-value pairs. A key is a <a href="#dfn-strings" class="internalDFN" data-link-type="dfn">string</a>. A single colon comes after
    each key, separating the key from the value. A single comma separates a value
    from a following key. In JSON-LD the keys in an object <em class="rfc2119" title="MUST">MUST</em> be unique.
    In the <a href="#dfn-internal-representation" class="internalDFN" data-link-type="dfn">internal representation</a> a <a href="#dfn-json-objects" class="internalDFN" data-link-type="dfn">JSON object</a> is equivalent to a
    <dfn data-lt="dictionaries|dictionary" class="preserve" data-dfn-type="dfn" id="dfn-dictionaries"><a href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a></dfn> (see [<cite><a class="bibref" href="#bib-WEBIDL">WEBIDL</a></cite>]).</dd>
  <dt class="changed"><dfn data-lt="internal representation|json-ld internal representation" id="dfn-internal-representation" data-dfn-type="dfn">JSON-LD internal representation</dfn></dt><dd class="changed">The JSON-LD
    internal representation is the result of transforming a JSON syntactic structure
    into the core data structures suitable for direct processing:
    <a href="#dfn-arrays" class="internalDFN" data-link-type="dfn">arrays</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionaries</a>,
    <a href="#dfn-strings" class="internalDFN" data-link-type="dfn">strings</a>, <a href="#dfn-numbers" class="internalDFN" data-link-type="dfn">numbers</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#idl-boolean">booleans</a>, and <a href="#dfn-null" class="internalDFN" data-link-type="dfn">null</a>.</dd>
  <dt><dfn id="dfn-null" data-dfn-type="dfn">null</dfn></dt><dd>
    The use of the <a class="externalDFN" href="https://tools.ietf.org/html/rfc7159#section-3">null</a> value within JSON-LD is used to
    ignore or reset values. A key-value pair in the <code>@context</code> where
    the value, or the <code>@id</code> of the value, is <code>null</code>
    explicitly decouples a term's association with an <abbr title="Internationalized Resource Identifier">IRI</abbr>. A key-value pair in
    the body of a <a href="#dfn-json-ld-documents" class="internalDFN" data-link-type="dfn">JSON-LD document</a> whose value is <code>null</code> has the
    same meaning as if the key-value pair was not defined. If
    <code>@value</code>, <code>@list</code>, or <code>@set</code> is set to
    <code>null</code> in expanded form, then the entire <a href="#dfn-json-objects" class="internalDFN" data-link-type="dfn">JSON
    object</a> is ignored.</dd>
  <dt><dfn data-lt="numbers|json number|json numbers|number" id="dfn-numbers" data-dfn-type="dfn">number</dfn></dt><dd>
    In the JSON serialization, a <a class="externalDFN" href="https://tools.ietf.org/html/rfc7159#section-6">number</a> is similar to that used in most programming languages, except
    that the octal and hexadecimal formats are not used and that leading
    zeros are not allowed.
    In the <a href="#dfn-internal-representation" class="internalDFN" data-link-type="dfn">internal representation</a>, a <a href="#dfn-numbers" class="internalDFN" data-link-type="dfn">number</a> is equivalent to either
    a <dfn class="preserve" data-dfn-type="dfn" id="dfn-long"><a href="https://heycam.github.io/webidl/#idl-long">long</a></dfn>
    or <dfn class="preserve" data-dfn-type="dfn" id="dfn-double"><a href="https://heycam.github.io/webidl/#idl-double">double</a></dfn>, depending
    on if the number has a non-zero fractional part (see [<cite><a class="bibref" href="#bib-WEBIDL">WEBIDL</a></cite>]).</dd>
  <dt></dt>
  <dt><dfn data-lt="strings|string" id="dfn-strings" data-dfn-type="dfn">string</dfn></dt><dd>
    A <a class="externalDFN" href="https://tools.ietf.org/html/rfc7159#section-7">string</a> is a sequence of zero or more Unicode (UTF-8) characters,
    wrapped in double quotes, using backslash escapes (if necessary). A
    character is represented as a single character string.</dd>
  <dt><dfn id="dfn-true" data-dfn-type="dfn">true</dfn> and <dfn id="dfn-false" data-dfn-type="dfn">false</dfn></dt><dd>
    <a class="externalDFN" href="https://tools.ietf.org/html/rfc7159#section-3">Values</a> that are used to express one of two possible
    <dfn data-lt="booleans|boolean" class="preserve" data-dfn-type="dfn" id="dfn-booleans"><a href="https://heycam.github.io/webidl/#idl-boolean">boolean</a></dfn> states.</dd></dl>

<p>Furthermore, the following terminology is used throughout this document:</p>

<dl class="termlist" data-sort=""><dt><dfn data-lt="absolute iris|absolute iri" id="dfn-absolute-iris" data-dfn-type="dfn">absolute <abbr title="Internationalized Resource Identifier">IRI</abbr></dfn></dt><dd>
    An <a class="externalDFN" href="https://tools.ietf.org/html/rfc3987#section-1.3">absolute <abbr title="Internationalized Resource Identifier">IRI</abbr></a> is defined in [<cite><a class="bibref" href="#bib-RFC3987">RFC3987</a></cite>] containing a <em>scheme</em> along with a <em>path</em> and
    optional <em>query</em> and fragment segments.</dd>
  <dt><dfn id="dfn-active-context" data-dfn-type="dfn">active context</dfn></dt><dd>
    A <a href="#dfn-contexts" class="internalDFN" data-link-type="dfn">context</a> that is used to resolve <a href="#dfn-terms" class="internalDFN" data-link-type="dfn">terms</a> while the processing
    algorithm is running.</dd>
  <dt><dfn data-lt="base iris|base iri" id="dfn-base-iris" data-dfn-type="dfn">base <abbr title="Internationalized Resource Identifier">IRI</abbr></dfn></dt><dd>
    The <a href="#dfn-base-iris" class="internalDFN" data-link-type="dfn">base <abbr title="Internationalized Resource Identifier">IRI</abbr></a> is an <a href="#dfn-absolute-iris" class="internalDFN" data-link-type="dfn">absolute <abbr title="Internationalized Resource Identifier">IRI</abbr></a> established in the <a href="#dfn-contexts" class="internalDFN" data-link-type="dfn">context</a>,
    or is based on the <a href="#dfn-json-ld-documents" class="internalDFN" data-link-type="dfn">JSON-LD document</a> location. The <a href="#dfn-base-iris" class="internalDFN" data-link-type="dfn">base <abbr title="Internationalized Resource Identifier">IRI</abbr></a> is used to turn
    <a href="#dfn-relative-iris" class="internalDFN" data-link-type="dfn">relative IRIs</a> into <a href="#dfn-absolute-iris" class="internalDFN" data-link-type="dfn">absolute IRIs</a>.</dd>
  <dt><dfn data-lt="blank nodes|blank node" id="dfn-blank-nodes" data-dfn-type="dfn">blank node</dfn></dt><dd>
    A <a href="#dfn-nodes" class="internalDFN" data-link-type="dfn">node</a> in a <a href="#dfn-graph" class="internalDFN" data-link-type="dfn">graph</a> that is neither an
    <a href="#dfn-iris" class="internalDFN" data-link-type="dfn"><abbr title="Internationalized Resource Identifier">IRI</abbr></a>, nor a <a href="#dfn-json-ld-values" class="internalDFN" data-link-type="dfn">JSON-LD value</a>, nor a <a href="#dfn-lists" class="internalDFN" data-link-type="dfn">list</a>.
    A <a class="externalDFN" href="https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node">blank node</a> does not contain a de-referenceable
    identifier because it is either ephemeral in nature or does not contain information that needs to be
    linked to from outside of the <a href="#dfn-graph" class="internalDFN" data-link-type="dfn">linked data graph</a>. A blank node is assigned an identifier starting with
    the prefix <code>_:</code>.</dd>
  <dt><dfn data-lt="blank node identifiers|blank node identifier" id="dfn-blank-node-identifiers" data-dfn-type="dfn">blank node identifier</dfn></dt><dd>
    A <a class="externalDFN" href="https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node-identifier">blank node identifier</a> is a string that can be used as an identifier for a
    <a href="#dfn-blank-nodes" class="internalDFN" data-link-type="dfn">blank node</a> within the scope of a JSON-LD document. Blank node identifiers
    begin with <code>_:</code>.</dd>
  <dt></dt>
  <dt><dfn data-lt="contexts|context" id="dfn-contexts" data-dfn-type="dfn">context</dfn></dt><dd>
    A a set of rules for interpreting a <a href="#dfn-json-ld-documents" class="internalDFN" data-link-type="dfn">JSON-LD document</a> as specified in
    <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld/#the-context">The Context</a> of the JSON-LD Syntax specification [<cite><a class="bibref" href="#bib-JSON-LD11CG">JSON-LD11CG</a></cite>].</dd>
  <dt></dt>
  <dt><dfn id="dfn-default-graph" data-dfn-type="dfn">default graph</dfn></dt><dd>
    The <a class="externalDFN" href="https://www.w3.org/TR/rdf11-concepts/#dfn-default-graph">default graph</a> is the only graph in a JSON-LD document which has no <a href="#dfn-graph-names" class="internalDFN" data-link-type="dfn">graph name</a>.
    When executing an algorithm, the graph where data should be placed
    if a <a href="#dfn-named-graphs" class="internalDFN" data-link-type="dfn">named graph</a> is not specified.</dd>
  <dt></dt>
  <dt><dfn id="dfn-default-object" data-dfn-type="dfn">default object</dfn></dt><dd>
    A <a href="#dfn-default-object" class="internalDFN" data-link-type="dfn">default object</a> is a <a href="#dfn-json-objects" class="internalDFN" data-link-type="dfn">JSON object</a> that has a <code>@default</code> member.</dd>
  <dt><dfn data-lt="edges|edge" id="dfn-edges" data-dfn-type="dfn">edge</dfn></dt><dd>
    Every <a href="#dfn-edges" class="internalDFN" data-link-type="dfn">edge</a> has a direction associated with it and is labeled with
    an <a href="#dfn-iris" class="internalDFN" data-link-type="dfn"><abbr title="Internationalized Resource Identifier">IRI</abbr></a> or a <a href="#dfn-blank-node-identifiers" class="internalDFN" data-link-type="dfn">blank node identifier</a>. Within the JSON-LD syntax
    these edge labels are called <a href="#dfn-properties" class="internalDFN" data-link-type="dfn">properties</a>. Whenever possible, an
    <a href="#dfn-edges" class="internalDFN" data-link-type="dfn">edge</a> should be labeled with an <a href="#dfn-iris" class="internalDFN" data-link-type="dfn"><abbr title="Internationalized Resource Identifier">IRI</abbr></a>.</dd>
  <dt></dt>
  <dt><dfn data-lt="json-ld frame|frames|frame" id="dfn-json-ld-frame" data-dfn-type="dfn">Frame</dfn></dt><dd>
    A <a href="#dfn-json-ld-documents" class="internalDFN" data-link-type="dfn">JSON-LD document</a>, which describes the form for transforming
    another <a href="#dfn-json-ld-documents" class="internalDFN" data-link-type="dfn">JSON-LD document</a> using matching and embedding rules.
    A frame document allows additional keywords and certain property values
    to describe the matching and transforming process.</dd>
  <dt><dfn id="dfn-frame-object" data-dfn-type="dfn">frame object</dfn></dt><dd>
    A frame object is a <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a> element within a <a href="#dfn-json-ld-frame" class="internalDFN" data-link-type="dfn">frame</a>
    which represents a specific portion of the <a href="#dfn-json-ld-frame" class="internalDFN" data-link-type="dfn">frame</a> matching either a
    <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a> or a <a href="#dfn-value-objects" class="internalDFN" data-link-type="dfn">value object</a> in the input.</dd>
  <dt><dfn data-lt="graph names|graph name" id="dfn-graph-names" data-dfn-type="dfn">graph name</dfn></dt><dd>
    The <a href="#dfn-iris" class="internalDFN" data-link-type="dfn"><abbr title="Internationalized Resource Identifier">IRI</abbr></a> identifying a <a class="externalDFN" href="https://www.w3.org/TR/rdf11-concepts/#dfn-graph-name">named graph</a>.</dd>
  <dt class="changed"></dt>
 <dt class="changed"></dt>
  <dt></dt>
  <dt></dt>
  <dt><dfn data-lt="iris|internationalized resource identifier|iri" id="dfn-iris" data-dfn-type="dfn"><abbr title="Internationalized Resource Identifier">IRI</abbr></dfn></dt><dd>
    An <a class="externalDFN" href="https://tools.ietf.org/html/rfc3987#section-1.3">Internationalized Resource Identifier</a> as described in [<cite><a class="bibref" href="#bib-RFC3987">RFC3987</a></cite>].</dd>
  <dt><dfn data-lt="json-ld documents|json-ld document" id="dfn-json-ld-documents" data-dfn-type="dfn">JSON-LD document</dfn></dt><dd>
    A <a href="#dfn-json-ld-documents" class="internalDFN" data-link-type="dfn">JSON-LD document</a> is a serialization of a collection of
    <a href="#dfn-graph" class="internalDFN" data-link-type="dfn">graphs</a> and comprises exactly one
    <a href="#dfn-default-graph" class="internalDFN" data-link-type="dfn">default graph</a> and zero or more <a href="#dfn-named-graphs" class="internalDFN" data-link-type="dfn">named graphs</a>.</dd>
  <dt><dfn data-lt="json-ld processors|processors|json-ld processor" id="dfn-json-ld-processors" data-dfn-type="dfn">JSON-LD Processor</dfn></dt><dd>
    A <a href="#dfn-json-ld-processors" class="internalDFN" data-link-type="dfn">JSON-LD Processor</a> is a system which can perform the algorithms defined in [<cite><a class="bibref" href="#bib-JSON-LD11CG-API">JSON-LD11CG-API</a></cite>].</dd>
  <dt><dfn data-lt="json-ld values|json-ld value" id="dfn-json-ld-values" data-dfn-type="dfn">JSON-LD value</dfn></dt><dd>
    A <a data-lt="JSON-LD values" href="#dfn-json-ld-values" class="internalDFN" data-link-type="dfn">JSON-LD value</a> is a <a href="#dfn-strings" class="internalDFN" data-link-type="dfn">string</a>, a <a href="#dfn-numbers" class="internalDFN" data-link-type="dfn">number</a>,
    <a href="#dfn-true" class="internalDFN" data-link-type="dfn">true</a> or <a href="#dfn-false" class="internalDFN" data-link-type="dfn">false</a>, a <a href="#dfn-typed-values" class="internalDFN" data-link-type="dfn">typed value</a>, or a
    <a href="#dfn-language-tagged-strings" class="internalDFN" data-link-type="dfn">language-tagged string</a>.</dd>
  <dt><dfn data-lt="keywords|keyword" id="dfn-keywords" data-dfn-type="dfn">keyword</dfn></dt><dd>
    A JSON key that is specific to JSON-LD, specified in the JSON-LD Syntax specification [<cite><a class="bibref" href="#bib-JSON-LD11CG">JSON-LD11CG</a></cite>]
    in the section titled <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld/#syntax-tokens-and-keywords">Syntax Tokens and Keywords</a>.</dd>
  <dt></dt>
  <dt><dfn data-lt="language-tagged strings|language-tagged string" id="dfn-language-tagged-strings" data-dfn-type="dfn">language-tagged string</dfn></dt><dd>
    A <a class="externalDFN" href="https://www.w3.org/TR/rdf11-concepts/#dfn-language-tagged-string">language-tagged string</a> consists of a string and a non-empty language
    tag as defined by [<cite><a class="bibref" href="#bib-BCP47">BCP47</a></cite>]. The  <em class="rfc2119" title="MUST">MUST</em> be well-formed according to
    <a href="https://tools.ietf.org/html/bcp47#section-2.2.9">section 2.2.9 Classes of Conformance</a>
    of [<cite><a class="bibref" href="#bib-BCP47">BCP47</a></cite>], and is normalized to lowercase.</dd>
  <dd>
    A set of documents, each containing a representation of a <a href="#dfn-graph" class="internalDFN" data-link-type="dfn">linked data graph</a>.</dd>
  <dt><dfn data-lt="graph|graphs|linked data graph" id="dfn-graph" data-dfn-type="dfn">linked data graph</dfn></dt><dd>
    A labeled directed <a class="externalDFN" href="https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-graph">graph</a>, i.e., a set of <a href="#dfn-nodes" class="internalDFN" data-link-type="dfn">nodes</a>
    connected by <a href="#dfn-edges" class="internalDFN" data-link-type="dfn">edges</a>,
    as specified in the <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld/#data-model">Data Model</a>
    section of the JSON-LD specification [<cite><a class="bibref" href="#bib-JSON-LD11CG">JSON-LD11CG</a></cite>].
    A <a href="#dfn-graph" class="internalDFN" data-link-type="dfn">linked data graph</a> is a generalized representation of an
    <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-graph">RDF graph</a>
    as defined in [<cite><a class="bibref" href="#bib-RDF-CONCEPTS">RDF-CONCEPTS</a></cite>].</dd>
  <dt><dfn data-lt="lists|list" id="dfn-lists" data-dfn-type="dfn">list</dfn></dt><dd>
    A <a href="#dfn-lists" class="internalDFN" data-link-type="dfn">list</a> is an ordered sequence of <a href="#dfn-iris" class="internalDFN" data-link-type="dfn">IRIs</a>,
    <a href="#dfn-blank-nodes" class="internalDFN" data-link-type="dfn">blank nodes</a>, and <a href="#dfn-json-ld-values" class="internalDFN" data-link-type="dfn">JSON-LD values</a>.
    See <dfn data-lt="collection|rdf collection" class="preserve" data-dfn-type="dfn" id="dfn-collection"><a href="https://www.w3.org/TR/rdf-schema/#ch_collectionvocab">RDF collection</a></dfn>
    in [<cite><a class="bibref" href="#bib-RDF-SCHEMA">RDF-SCHEMA</a></cite>].</dd>
  <dt></dt>
  <dt></dt>
  <dt></dt>
  <dt><dfn data-lt="named graphs|named graph" id="dfn-named-graphs" data-dfn-type="dfn">named graph</dfn></dt><dd>
    A <a class="externalDFN" href="https://www.w3.org/TR/rdf11-concepts/#dfn-named-graph">named graph</a> is a <a href="#dfn-graph" class="internalDFN" data-link-type="dfn">linked data graph</a> that is identified by an <a href="#dfn-iris" class="internalDFN" data-link-type="dfn"><abbr title="Internationalized Resource Identifier">IRI</abbr></a> or <a href="#dfn-blank-nodes" class="internalDFN" data-link-type="dfn">blank node</a>.</dd>
  <dt></dt>
  <dt><dfn data-lt="nodes|node" id="dfn-nodes" data-dfn-type="dfn">node</dfn></dt><dd>
    Every <a class="externalDFN" href="https://www.w3.org/TR/rdf11-concepts/#dfn-node">node</a> is an <a href="#dfn-iris" class="internalDFN" data-link-type="dfn"><abbr title="Internationalized Resource Identifier">IRI</abbr></a>, a <a href="#dfn-blank-nodes" class="internalDFN" data-link-type="dfn">blank node</a>,
    a <a href="#dfn-json-ld-values" class="internalDFN" data-link-type="dfn">JSON-LD value</a>, or a <a href="#dfn-lists" class="internalDFN" data-link-type="dfn">list</a>.
    A piece of information that is represented in a <a href="#dfn-graph" class="internalDFN" data-link-type="dfn">linked data graph</a>.</dd>
  <dt><dfn data-lt="node objects|node object" id="dfn-node-objects" data-dfn-type="dfn">node object</dfn></dt><dd>
    A <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a> represents zero or more <a href="#dfn-properties" class="internalDFN" data-link-type="dfn">properties</a> of a
    <a href="#dfn-nodes" class="internalDFN" data-link-type="dfn">node</a> in the <a href="#dfn-graph" class="internalDFN" data-link-type="dfn">graph</a> serialized by the
    <a href="#dfn-json-ld-documents" class="internalDFN" data-link-type="dfn">JSON-LD document</a>. A <a href="#dfn-json-objects" class="internalDFN" data-link-type="dfn">JSON object</a> is a <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a>
    if it exists outside of the JSON-LD <a href="#dfn-contexts" class="internalDFN" data-link-type="dfn">context</a> and:
    <ul>
      <li>it does not contain the <code>@value</code>, <code>@list</code>,
        or <code>@set</code> keywords, or</li>
      <li>it is not the top-most <a href="#dfn-json-objects" class="internalDFN" data-link-type="dfn">JSON object</a> in the JSON-LD document consisting
        of no other members than <code>@graph</code> and <code>@context</code>.</li>
    </ul>
  </dd>
  <dt><dfn data-lt="node references|node reference" id="dfn-node-references" data-dfn-type="dfn">node reference</dfn></dt><dd>
    A <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a> used to reference a node having only the
    <code>@id</code> key.</dd>
  <dt><dfn data-lt="objects|object" id="dfn-objects" data-dfn-type="dfn">object</dfn></dt><dd>
    An <a class="externalDFN" href="https://www.w3.org/TR/rdf11-concepts/#dfn-object">object</a> is a <a href="#dfn-nodes" class="internalDFN" data-link-type="dfn">node</a> in a <a href="#dfn-graph" class="internalDFN" data-link-type="dfn">linked data graph</a> with at least one incoming edge.
    See <dfn class="preserve" data-dfn-type="dfn" id="dfn-rdf-object"><a href="https://www.w3.org/TR/rdf11-concepts/#dfn-object">RDF object</a></dfn>in [<cite><a class="bibref" href="#bib-RDF11-CONCEPTS">RDF11-CONCEPTS</a></cite>].</dd>
  <dt></dt>
  <dt><dfn id="dfn-processing-mode" data-dfn-type="dfn">processing mode</dfn></dt><dd>
    The processing mode defines how a JSON-LD document is processed.
    By default, all documents are assumed to be conformant with
    <a href="https://www.w3.org/TR/json-ld/">JSON-LD 1.0</a> [<cite><a class="bibref" href="#bib-JSON-LD">JSON-LD</a></cite>]. By defining
    a different version using the <code>@version</code> member in a
    <a href="#dfn-contexts" class="internalDFN" data-link-type="dfn">context</a>, or via explicit API option, other processing modes
    can be accessed. This specification defines extensions for the
    <code>json-ld-1.1</code> <a href="#dfn-processing-mode" class="internalDFN" data-link-type="dfn">processing mode</a>.</dd>
  <dt><dfn data-lt="properties|property" id="dfn-properties" data-dfn-type="dfn">property</dfn></dt><dd>
    The <a href="#dfn-iris" class="internalDFN" data-link-type="dfn"><abbr title="Internationalized Resource Identifier">IRI</abbr></a> label of an edge in a <a href="#dfn-graph" class="internalDFN" data-link-type="dfn">linked data graph</a>.
    See <dfn data-lt="predicate|predicates|rdf predicates|rdf predicate" class="preserve" data-dfn-type="dfn" id="dfn-predicate"><a href="https://www.w3.org/TR/rdf11-concepts/#dfn-predicate">RDF predicate</a></dfn> in [<cite><a class="bibref" href="#bib-RDF11-CONCEPTS">RDF11-CONCEPTS</a></cite>].</dd>
    <dt></dt>
  <dt></dt>
  <dt></dt>
  <dt></dt>
  <dt><dfn data-lt="relative iris|relative iri" id="dfn-relative-iris" data-dfn-type="dfn">relative <abbr title="Internationalized Resource Identifier">IRI</abbr></dfn></dt><dd>
    A relative <abbr title="Internationalized Resource Identifier">IRI</abbr> is an <a href="#dfn-iris" class="internalDFN" data-link-type="dfn"><abbr title="Internationalized Resource Identifier">IRI</abbr></a> that is relative to some other <a href="#dfn-absolute-iris" class="internalDFN" data-link-type="dfn">absolute <abbr title="Internationalized Resource Identifier">IRI</abbr></a>,
    typically the <a href="#dfn-base-iris" class="internalDFN" data-link-type="dfn">base <abbr title="Internationalized Resource Identifier">IRI</abbr></a> of the document. Note that
    <a href="#dfn-properties" class="internalDFN" data-link-type="dfn">properties</a>, values of <code>@type</code>, and values of <a href="#dfn-terms" class="internalDFN" data-link-type="dfn">terms</a> defined to be <em>vocabulary relative</em>
    are resolved relative to the <a href="#dfn-vocabulary-mapping" class="internalDFN" data-link-type="dfn">vocabulary mapping</a>, not the <a href="#dfn-base-iris" class="internalDFN" data-link-type="dfn">base <abbr title="Internationalized Resource Identifier">IRI</abbr></a>.</dd>
  <dt></dt>
  <dt><dfn data-lt="subjects|subject" id="dfn-subjects" data-dfn-type="dfn">subject</dfn></dt><dd>
    A <a class="externalDFN" href="https://www.w3.org/TR/rdf11-concepts/#dfn-subject">subject</a> is a<a href="#dfn-nodes" class="internalDFN" data-link-type="dfn">node</a> in a <a href="#dfn-graph" class="internalDFN" data-link-type="dfn">linked data graph</a> with at least one outgoing edge, related to an <a href="#dfn-objects" class="internalDFN" data-link-type="dfn">object</a> node through a <a href="#dfn-properties" class="internalDFN" data-link-type="dfn">property</a>.
    See <dfn class="preserve" data-dfn-type="dfn" id="dfn-rdf-subject"><a href="https://www.w3.org/TR/rdf11-concepts/#dfn-subject">RDF subject</a></dfn> in [<cite><a class="bibref" href="#bib-RDF11-CONCEPTS">RDF11-CONCEPTS</a></cite>].</dd>
    <dt><dfn data-lt="terms|term" id="dfn-terms" data-dfn-type="dfn">term</dfn></dt><dd>
    A <a href="#dfn-terms" class="internalDFN" data-link-type="dfn">term</a> is a short word defined in a <a href="#dfn-contexts" class="internalDFN" data-link-type="dfn">context</a> that <em class="rfc2119" title="MAY">MAY</em> be expanded to an <a href="#dfn-iris" class="internalDFN" data-link-type="dfn"><abbr title="Internationalized Resource Identifier">IRI</abbr></a>
  </dd>
  <dt></dt>
  <dt class="changed"></dt>
  <dt></dt>
  <dt><dfn data-lt="typed values|typed value" id="dfn-typed-values" data-dfn-type="dfn">typed value</dfn></dt><dd>
    A <a href="#dfn-typed-values" class="internalDFN" data-link-type="dfn">typed value</a> consists of a value, which is a <a href="#dfn-strings" class="internalDFN" data-link-type="dfn">string</a>, and a type,
    which is an <a href="#dfn-iris" class="internalDFN" data-link-type="dfn"><abbr title="Internationalized Resource Identifier">IRI</abbr></a>.</dd>
  <dt><dfn data-lt="value objects|value object" id="dfn-value-objects" data-dfn-type="dfn">value object</dfn></dt><dd>
    A <a href="#dfn-value-objects" class="internalDFN" data-link-type="dfn">value object</a> is a <a href="#dfn-json-objects" class="internalDFN" data-link-type="dfn">JSON object</a> that has an <code>@value</code>
    member.</dd>
  <dt><dfn id="dfn-vocabulary-mapping" data-dfn-type="dfn">vocabulary mapping</dfn></dt><dd>
    The vocabulary mapping is set in the <a href="#dfn-contexts" class="internalDFN" data-link-type="dfn">context</a> using the <code>@vocab</code> key whose
    value <em class="rfc2119" title="MUST">MUST</em> be an <a href="#dfn-absolute-iris" class="internalDFN" data-link-type="dfn">absolute <abbr title="Internationalized Resource Identifier">IRI</abbr></a> <code>null</code>.</dd></dl>
</div>

  <section id="algorithm-terms">
    <h4 id="x1-3-1-algorithm-terms"><span class="secno">1.3.1 </span>Algorithm Terms&nbsp;<span class="permalink"><a href="#algorithm-terms" aria-label="Permalink for 1.3.1 Algorithm Terms" title="Permalink for 1.3.1 Algorithm Terms"><span>§</span></a></span></h4>

    <p>The Following terms are used within specific algorithms.</p>

    <div data-oninclude="restrictReferences"><dl class="termlist" data-sort="" id="terms-0"><dt></dt>
  <dt></dt>
  <dt><dfn id="dfn-active-property" data-dfn-type="dfn">active property</dfn></dt><dd>
    The currently active <a href="#dfn-properties" class="internalDFN" data-link-type="dfn">property</a> or <a href="#dfn-keywords" class="internalDFN" data-link-type="dfn">keyword</a> that the processor
    should use when processing. The <a href="#dfn-active-property" class="internalDFN" data-link-type="dfn">active property</a> is represented in
    the original lexical form, which is used for finding coercion mappings in
    the <a href="#dfn-active-context" class="internalDFN" data-link-type="dfn">active context</a>.</dd>
  <dt></dt>
  <dt><dfn id="dfn-explicit-inclusion-flag" data-dfn-type="dfn">explicit inclusion flag</dfn></dt><dd>
    A flag specifying that for <a href="#dfn-properties" class="internalDFN" data-link-type="dfn">properties</a> to be included in the output, they
    must be explicitly declared in the matching <a href="#dfn-json-ld-frame" class="internalDFN" data-link-type="dfn">frame</a>.</dd>
  <dt><dfn id="dfn-framing-state" data-dfn-type="dfn">framing state</dfn></dt><dd>
    A <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a> containing values for the
    <a href="#dfn-object-embed-flag" class="internalDFN" data-link-type="dfn">object embed flag</a>, the
    <a href="#dfn-require-all-flag" class="internalDFN" data-link-type="dfn">require all flag</a>, the
    <a href="#dfn-explicit-inclusion-flag" class="internalDFN" data-link-type="dfn">explicit inclusion flag</a>, and the
    <a href="#dfn-omit-default-flag" class="internalDFN" data-link-type="dfn">omit default flag</a>.</dd>
  <dt><dfn id="dfn-input-frame" data-dfn-type="dfn">input frame</dfn></dt><dd>
    The initial <a href="#dfn-json-ld-frame" class="internalDFN" data-link-type="dfn">Frame</a> provided to the framing algorithm.</dd>
  <dt><dfn id="dfn-json-ld-input" data-dfn-type="dfn">JSON-LD input</dfn></dt><dd>
    The JSON-LD data structure that is provided as input to the algorithm.</dd>
  <dt><dfn id="dfn-json-ld-output" data-dfn-type="dfn">JSON-LD output</dfn></dt><dd>
    The JSON-LD data structure that is produced as output by the algorithm.</dd>
  <dt><dfn id="dfn-map-of-flattened-subjects" data-dfn-type="dfn">map of flattened subjects</dfn></dt><dd>
    A map of subjects that is the result of the
    <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#node-map-generation">Node Map Generation algorithm</a>.</dd>
  <dt><dfn id="dfn-object-embed-flag" data-dfn-type="dfn">object embed flag</dfn></dt><dd>
    A flag specifying that <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node objects</a> should be directly embedded in the output,
    instead of being referred to by their <a href="#dfn-iris" class="internalDFN" data-link-type="dfn"><abbr title="Internationalized Resource Identifier">IRI</abbr></a>.</dd>
  <dt><dfn id="dfn-omit-default-flag" data-dfn-type="dfn">omit default flag</dfn></dt><dd>
    A flag specifying that properties that are missing from the
    <a href="#dfn-json-ld-input" class="internalDFN" data-link-type="dfn">JSON-LD input</a>, but present in the <a href="#dfn-input-frame" class="internalDFN" data-link-type="dfn">input frame</a>
    should be omitted from the output.</dd>
  <dt class="changed"><dfn id="dfn-omit-graph-flag" data-dfn-type="dfn">omit graph flag</dfn></dt><dd class="changed">
    A flag that determines if framing output is always contained within a
    <code>@graph</code> member, or only if required to represent multiple <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node objects</a>.</dd>
  <dt></dt>
  <dt><dfn data-lt="promises|promise" id="dfn-promises" data-dfn-type="dfn">promise</dfn></dt><dd>
    A <a class="externalDFN" href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise-objects">promise</a> is an object that represents the eventual result of a single asynchronous operation.
    Promises are defined in [<cite><a class="bibref" href="#bib-ECMASCRIPT-6.0">ECMASCRIPT-6.0</a></cite>].</dd>
  <dt><dfn id="dfn-require-all-flag" data-dfn-type="dfn">require all flag</dfn></dt><dd>
    A flag specifying that all properties present in the <a href="#dfn-input-frame" class="internalDFN" data-link-type="dfn">input frame</a>
    <em class="rfc2119" title="MUST">MUST</em> either have a default value or be present in the <a href="#dfn-json-ld-input" class="internalDFN" data-link-type="dfn">JSON-LD
    input</a> for the frame to match.</dd></dl>
</div>
  </section>

</section>

<section id="typographical-conventions">
  <h3 id="x1-4-typographical-conventions"><span class="secno">1.4 </span>Typographical conventions&nbsp;<span class="permalink"><a href="#typographical-conventions" aria-label="Permalink for 1.4 Typographical conventions" title="Permalink for 1.4 Typographical conventions"><span>§</span></a></span></h3>
  <div>      <p>The following typographic conventions are used in this specification:</p>

      <dl class="typography">
        <dt><code>markup</code></dt>
        <dd>Markup (elements, attributes, properties), machine processable values (string, characters, media types), property name, or a file name is in red-orange monospace font.</dd>
        <dt><var>variable</var></dt>
        <dd>A variable in pseudo-code or in an algorithm description is in italics.</dd>
        <dt><dfn data-dfn-type="dfn" id="dfn-definition">definition</dfn></dt>
        <dd>A definition of a term, to be used elsewhere in this or other specifications, is in bold and italics.</dd>
        <dt><a data-lt="definition" href="#dfn-definition" class="internalDFN" data-link-type="dfn">definition reference</a></dt>
        <dd>A reference to a definition <em>in this document</em> is underlined and is also an active link to the definition itself. </dd>
        <dt><a data-lt="definition" href="#dfn-definition" class="internalDFN" data-link-type="dfn"><code>markup definition reference</code></a></dt>
        <dd>A references to a definition <em>in this document</em>, when the reference itself is also a markup, is underlined, red-orange monospace font, and is also an active link to the definition itself.</dd>
        <dt><a class="externalDFN">external definition reference</a></dt>
        <dd>A reference to a definition <em>in another document</em> is underlined, in italics, and is also an active link to the definition itself.</dd>
        <dt><a class="externalDFN"><code> markup external definition reference</code></a></dt>
        <dd>A reference to a definition <em>in another document</em>, when the reference itself is also a markup, is underlined, in italics red-orange monospace font, and is also an active link to the definition itself.</dd>
        <dt><a href=".">hyperlink</a></dt>
        <dd>A hyperlink is underlined and in blue.</dd>
        <dt>[<a href=".">reference</a>]</dt>
        <dd>A document reference (normative or informative) is enclosed in square brackets and links to the references section.</dd>
        <dt class="changed">Changes from Recommendation</dt>
        <dd>Sections or phrases changed from the previous Recommendation are <span class="changed">highlighted</span>.</dd>
      </dl>

      <div class="note" id="issue-container-generatedID"><div role="heading" class="note-title marker" id="h-note" aria-level="4"><span>Note</span></div><p class="">Notes are in light green boxes with a green left border and with a "Note" header in green. Notes are normative or informative depending on the whether they are in a normative or informative section, respectively.</p></div>

      <div class="example"><div class="example-title marker"><span>Example 1</span></div><pre class="hljs javascript" aria-busy="false">Examples are <span class="hljs-keyword">in</span> light khaki boxes, <span class="hljs-keyword">with</span> khaki left border, and <span class="hljs-keyword">with</span> a
numbered <span class="hljs-string">"Example"</span> header <span class="hljs-keyword">in</span> khaki. Examples are always informative.
The content <span class="hljs-keyword">of</span> the example is <span class="hljs-keyword">in</span> monospace font and may be syntax colored.</pre></div>
</div>
</section>

</section>

<section class="informative" id="features">
<!--OddPage--><h2 id="x2-features"><span class="secno">2. </span>Features&nbsp;<span class="permalink"><a href="#features" aria-label="Permalink for 2. Features" title="Permalink for 2. Features"><span>§</span></a></span></h2><p><em>This section is non-normative.</em></p>
  <section class="informative" id="framing">
    <h3 id="x2-1-framing"><span class="secno">2.1 </span>Framing&nbsp;<span class="permalink"><a href="#framing" aria-label="Permalink for 2.1 Framing" title="Permalink for 2.1 Framing"><span>§</span></a></span></h3><p><em>This section is non-normative.</em></p>
    <p><dfn data-dfn-type="dfn" id="dfn-framing">Framing</dfn> is used to shape the data in a <a href="#dfn-json-ld-documents" class="internalDFN" data-link-type="dfn">JSON-LD document</a>,
      using an example <a href="#dfn-json-ld-frame" class="internalDFN" data-link-type="dfn">frame</a> document which is used to both match the
      <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dfn-flattened">flattened</a>
      data and show an example of how the resulting data should be shaped.
      Matching is performed by using <a href="#dfn-properties" class="internalDFN" data-link-type="dfn">properties</a> present in in the <a href="#dfn-json-ld-frame" class="internalDFN" data-link-type="dfn">frame</a>
      to find objects in the data that share common values. Matching can be done
      either using all properties present in the frame, or any property in the frame.
      By chaining together objects using matched property values, objects can be embedded
      within one another.</p>

    <p>A <a href="#dfn-json-ld-frame" class="internalDFN" data-link-type="dfn">frame</a> also includes a <a href="#dfn-contexts" class="internalDFN" data-link-type="dfn">context</a>, which is used for compacting the resulting
      framed output.</p>

    <p>For example, assume the following JSON-LD frame:</p>
    <div class="example"><div class="example-title marker"><span>Example 2</span><span style="text-transform: none">: Sample library frame</span></div><pre class="nohighlight">{
  "@context": {"@vocab": "http://example.org/"},
  "@type": "Library",
  "contains": {
    "@type": "Book",
    "contains": {
      "@type": "Chapter"
    }
  }
}</pre></div>

    <p>This <a href="#dfn-json-ld-frame" class="internalDFN" data-link-type="dfn">frame</a> document describes an embedding structure that would place
      objects with type <code>ex:Library</code> at the top, with objects of
      type <code>ex:Book</code> that were linked to the library object using
      the <code>ex:contains</code> property embedded as property values. It also
      places objects of type <code>ex:Chapter</code> within the referencing ex:Book object
      as embedded values of the book object.</p>

    <p>When using a flattened set of objects that match the frame components:</p>
    <div class="example"><div class="example-title marker"><span>Example 3</span><span style="text-transform: none">: Flattened library objects</span></div><pre class="nohighlight">{
  "@context": {
    "@vocab": "http://example.org/",
    "contains": {"@type": "@id"}
  },
  "@graph": [{
    "@id": "http://example.org/library",
    "@type": "Library",
    "contains": "http://example.org/library/the-republic"
  }, {
    "@id": "http://example.org/library/the-republic",
    "@type": "Book",
    "creator": "Plato",
    "title": "The Republic",
    "contains": "http://example.org/library/the-republic#introduction"
  }, {
    "@id": "http://example.org/library/the-republic#introduction",
    "@type": "Chapter",
    "description": "An introductory chapter on The Republic.",
    "title": "The Introduction"
  }]
}</pre></div>

    <p>The Frame Algorithm can create a new document which follows the structure
      of the frame:</p>
    <div class="example"><div class="example-title marker"><span>Example 4</span><span style="text-transform: none">: Framed library objects</span></div><pre class="nohighlight">{
  "@context": {"@vocab": "http://example.org/"},
  "@graph": [{
    "@id": "http://example.org/library",
    "@type": "Library",
    "contains": {
      "@id": "http://example.org/library/the-republic",
      "@type": "Book",
      "contains": {
        "@id": "http://example.org/library/the-republic#introduction",
        "@type": "Chapter",
        "description": "An introductory chapter on The Republic.",
        "title": "The Introduction"
      },
      "creator": "Plato",
      "title": "The Republic"
    }
  }]
}</pre></div>

    <p>If <a href="#dfn-processing-mode" class="internalDFN" data-link-type="dfn">processing mode</a> is <code>json-ld-1.1</code>, or the <a href="#dfn-omit-graph-flag" class="internalDFN" data-link-type="dfn">omit graph flag</a> is <code>true</code>,
      the top-level <code>@graph</code> member may be omitted.</p>
    <div class="example"><div class="example-title marker"><span>Example 5</span><span style="text-transform: none">: Framed library objects with omitGraph set to false</span></div><pre class="nohighlight">{
  "@context": {"@vocab": "http://example.org/"},
  "@id": "http://example.org/library",
  "@type": "Library",
  "contains": {
    "@id": "http://example.org/library/the-republic",
    "@type": "Book",
    "contains": {
      "@id": "http://example.org/library/the-republic#introduction",
      "@type": "Chapter",
      "description": "An introductory chapter on The Republic.",
      "title": "The Introduction"
    },
    "creator": "Plato",
    "title": "The Republic"
  }
}</pre></div>

    <p>The <a href="#framing-algorithm">Framing Algorithm</a> does this by
      first expanding both the input frame and document. It then creates
      a <a href="#dfn-map-of-flattened-subjects" class="internalDFN" data-link-type="dfn">map of flattened subjects</a>. The outer-most <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a> within the frame
      is used to match objects in the map, in this case looking for <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node objects</a>
      which have an <code>@type</code> of <code>Library</code>, and a
      <code>contains</code> property with another
      frame used to match values of that property. The input document contains
      exactly one such <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a>. The value of contains also has
      a <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a>, which is then treated as a frame to match the set of <a href="#dfn-subjects" class="internalDFN" data-link-type="dfn">subjects</a>
      which are <code>contains</code> values of the <code>Library</code> object, and so forth.</p>
  </section>

  <section id="default-content">
    <h3 id="x2-2-default-content"><span class="secno">2.2 </span>Default content&nbsp;<span class="permalink"><a href="#default-content" aria-label="Permalink for 2.2 Default content" title="Permalink for 2.2 Default content"><span>§</span></a></span></h3>
    <p>A frame may specify properties that don't exist in an input file. If the
      <a href="#dfn-explicit-inclusion-flag" class="internalDFN" data-link-type="dfn">explicit inclusion flag</a> is <code>false</code>, the framing algorithm
      will add a property and value to the result. The <code>@default</code> property
      in a <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a> or <a href="#dfn-value-objects" class="internalDFN" data-link-type="dfn">value object</a> provides a default value to use in the resulting
      output document. If there is no <code>@default</code> value, the property will be output
      with a <code>null</code> value. (See <a href="#omit-default-flag" class="sectionRef sec-ref">section <span class="secno">2.3.3</span> <span class="sec-title">Omit default flag</span></a>
      for ways to avoid this).</p>

    <div class="note" id="issue-container-generatedID-0"><div role="heading" class="note-title marker" id="h-note-0" aria-level="4"><span>Note</span></div><p class="">The value of the property in the frame is not otherwise
      used in the output document. It's purpose is for frame matching and
      finding default values. Note the <em>description</em> value for <em>Library</em> in the following example.</p></div>
    <div class="example"><div class="example-title marker"><span>Example 6</span><span style="text-transform: none">: Sample library frame with @default value</span></div><pre class="nohighlight">{
  "@context": {"@vocab": "http://example.org/"},
  "@type": "Library",
  <span class="hl-bold">"description": "A great Library.",</span>
  "contains": {
    "@type": "Book",
    <span class="hl-bold">"description": {"@default": "A great book."},</span>
    "contains": {
      "@type": "Chapter"
    }
  }
}</pre></div>


    <div class="example"><div class="example-title marker"><span>Example 7</span><span style="text-transform: none">: Sample library output with @default value</span></div><pre class="nohighlight">{
  "@context": {"@vocab": "http://example.org/"},
  "@graph": [{
    "@id": "http://example.org/library",
    "@type": "Library",
    "contains": {
      "@id": "http://example.org/library/the-republic",
      "@type": "Book",
      "contains": {
        "@id": "http://example.org/library/the-republic#introduction",
        "@type": "Chapter",
        "description": "An introductory chapter on The Republic.",
        "title": "The Introduction"
      },
      "creator": "Plato",
      <span class="hl-bold">"description": "A great book.",</span>
      "title": "The Republic"
    },
  <span class="hl-bold">"description": null</span>
  }]
}</pre></div>

  </section>

  <section id="framing-flags">
    <h3 id="x2-3-framing-flags"><span class="secno">2.3 </span>Framing Flags&nbsp;<span class="permalink"><a href="#framing-flags" aria-label="Permalink for 2.3 Framing Flags" title="Permalink for 2.3 Framing Flags"><span>§</span></a></span></h3>
    <p>Framing can be controlled using <a data-lt="JsonLdOptions" data-link-type="dfn" href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dom-jsonldoptions">API options</a>,
      or by adding framing <a href="#dfn-keywords" class="internalDFN" data-link-type="dfn">keywords</a> within the <a href="#dfn-json-ld-frame" class="internalDFN" data-link-type="dfn">frame</a> as
      described in <a href="#framing-keywords" class="sectionRef sec-ref">section <span class="secno">4.1</span> <span class="sec-title">Syntax Tokens and Keywords</span></a>.</p>

    <div class="note" id="issue-container-generatedID-1"><div role="heading" class="note-title marker" id="h-note-1" aria-level="4"><span>Note</span></div><p class="">Framing flags set using keywords have effect only for the
      frame in which they appear, and for implicit frames which are created
      for objects where no frame object exists.</p></div>
    <section id="object-embed-flag">
      <h4 id="x2-3-1-object-embed-flag"><span class="secno">2.3.1 </span>Object Embed Flag&nbsp;<span class="permalink"><a href="#object-embed-flag" aria-label="Permalink for 2.3.1 Object Embed Flag" title="Permalink for 2.3.1 Object Embed Flag"><span>§</span></a></span></h4>

      <p>The <a href="#dfn-object-embed-flag" class="internalDFN" data-link-type="dfn">object embed flag</a> determines if a referenced
        <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a> is embedded as a property value of a referencing
        object, or kept as a <a href="#dfn-node-references" class="internalDFN" data-link-type="dfn">node reference</a>.
        The initial value for the <a href="#dfn-object-embed-flag" class="internalDFN" data-link-type="dfn">object embed flag</a> is set using the
        <a data-link-for="JsonLdOptions" href="#dom-jsonldoptions-embed" class="internalDFN" data-link-type="dfn"><code>embed</code></a> option.
        Consider the following frame
        based on the default <code>@last</code> value of the <a href="#dfn-object-embed-flag" class="internalDFN" data-link-type="dfn">object embed flag</a>:</p>

      <div class="example"><div class="example-title marker"><span>Example 8</span><span style="text-transform: none">: Sample library frame with implicit @embed set to @last</span></div><pre class="nohighlight">{
  "@context": {"@vocab": "http://example.org/"},
  "@type": "Library"
}</pre></div>

      <p>Because, the default for the <a href="#dfn-object-embed-flag" class="internalDFN" data-link-type="dfn">object embed flag</a> is <code>@last</code>
         (in addition to the <a href="#dfn-explicit-inclusion-flag" class="internalDFN" data-link-type="dfn">explicit inclusion flag</a> being <code>false</code>),
         non-listed properties are added two the output, and implicitly embedded
         using a default empty frame. As a result, the same output used in the
         <a href="#lib-example-output">Framed library objects</a> above is generated.</p>

       <p>However, if the <code>@embed</code> property is added explicitly with a
         value of <code>@never</code>, the values for <em>Book</em> and <em>Chapter</em> will be excluded.</p>

      <div class="example"><div class="example-title marker"><span>Example 9</span><span style="text-transform: none">: Sample library frame with explicit @embed set to @never</span></div><pre class="nohighlight">{
  "@context": {"@vocab": "http://example.org/"},
  "@type": "Library",
  "contains": {
    "@type": "Book",
    <span class="hl-bold">"@embed": "@never"</span>
  }
}</pre></div>

      <div class="example"><div class="example-title marker"><span>Example 10</span><span style="text-transform: none">: Framed library objects with @embed set to @never</span></div><pre class="nohighlight">{
  "@context": {"@vocab": "http://example.org/"},
  "@graph": [{
    "@id": "http://example.org/library",
    "@type": "Library",
    "contains": {
      <span class="hl-bold">"@id": "http://example.org/library/the-republic"</span>
    }
  }]
}</pre></div>
    </section>

    <section id="explicit-inclusion-flag">
      <h4 id="x2-3-2-explicit-inclusion-flag"><span class="secno">2.3.2 </span>Explicit inclusion flag&nbsp;<span class="permalink"><a href="#explicit-inclusion-flag" aria-label="Permalink for 2.3.2 Explicit inclusion flag" title="Permalink for 2.3.2 Explicit inclusion flag"><span>§</span></a></span></h4>
      <p>The <a href="#dfn-explicit-inclusion-flag" class="internalDFN" data-link-type="dfn">explicit inclusion flag</a> used to determine
        properties which will be included in the output document.
        The default value is <code>false</code>, which means that properties
        present in an input <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a> that are not in the associated frame will be
        included in the output object.
        The initial value for the <a href="#dfn-explicit-inclusion-flag" class="internalDFN" data-link-type="dfn">explicit inclusion flag</a> is set using the
        <a data-link-for="JsonLdOptions" href="#dom-jsonldoptions-explicit" class="internalDFN" data-link-type="dfn"><code>explicit</code></a> option.
        If <code>true</code>, only properties present in
        the input frame will be placed into the output.</p>

      <p>For example, take an expanded version of the library frame which include
        some properties from the input, but omit others.</p>

      <div class="example"><div class="example-title marker"><span>Example 11</span><span style="text-transform: none">: Sample library frame with @explicit set to true</span></div><pre class="nohighlight">{
  "@context": {"@vocab": "http://example.org/"},
  "@type": "Library",
  "description": {},
  "contains": {
    "@type": "Book",
    <span class="hl-bold">"@explicit": true,</span>
    <span class="hl-bold">"title": {},</span>
    "contains": {
      "@type": "Chapter"
    }
  }
}</pre></div>

      <p>The resulting output will exclude properties for Book which are not explicitly
        listed in the <a href="#dfn-frame-object" class="internalDFN" data-link-type="dfn">frame object</a>:</p>

    <div class="example"><div class="example-title marker"><span>Example 12</span><span style="text-transform: none">: Framed library objects with @explicit set to true</span></div><pre id="lib-example-output" class="hljs json" aria-busy="false">{
  <span class="hljs-attr">"@context"</span>: {<span class="hljs-attr">"@vocab"</span>: <span class="hljs-string">"http://example.org/"</span>},
  <span class="hljs-attr">"@graph"</span>: [{
    <span class="hljs-attr">"@id"</span>: <span class="hljs-string">"http://example.org/library"</span>,
    <span class="hljs-attr">"@type"</span>: <span class="hljs-string">"Library"</span>,
    <span class="hljs-attr">"contains"</span>: {
      <span class="hljs-attr">"@id"</span>: <span class="hljs-string">"http://example.org/library/the-republic"</span>,
      <span class="hljs-attr">"@type"</span>: <span class="hljs-string">"Book"</span>,
      <span class="hljs-attr">"contains"</span>: {
        <span class="hljs-attr">"@id"</span>: <span class="hljs-string">"http://example.org/library/the-republic#introduction"</span>,
        <span class="hljs-attr">"@type"</span>: <span class="hljs-string">"Chapter"</span>,
        <span class="hljs-attr">"description"</span>: <span class="hljs-string">"An introductory chapter on The Republic."</span>,
        <span class="hljs-attr">"title"</span>: <span class="hljs-string">"The Introduction"</span>
      },
      <span class="hljs-attr">"creator"</span>: <span class="hljs-string">"Plato"</span>,
      <span class="hljs-attr">"title"</span>: <span class="hljs-string">"The Republic"</span>
    }
  }]
}</pre></div>
    </section>

    <section id="omit-default-flag">
      <h4 id="x2-3-3-omit-default-flag"><span class="secno">2.3.3 </span>Omit default flag&nbsp;<span class="permalink"><a href="#omit-default-flag" aria-label="Permalink for 2.3.3 Omit default flag" title="Permalink for 2.3.3 Omit default flag"><span>§</span></a></span></h4>
      <p>The <a href="#dfn-omit-default-flag" class="internalDFN" data-link-type="dfn">omit default flag</a> changes the way framing generates output when a property
        described in the frame is not present in the input document.
        The initial value for the <a href="#dfn-omit-default-flag" class="internalDFN" data-link-type="dfn">omit default flag</a> is set using the
        <a data-link-for="JsonLdOptions" href="#dom-jsonldoptions-omitdefault" class="internalDFN" data-link-type="dfn"><code>omitDefault</code></a> option.
        See <a href="#default-content" class="sectionRef sec-ref">section <span class="secno">2.2</span> <span class="sec-title">Default content</span></a> for a further discussion.</p>
    </section>

    <section class="changed" id="omit-graph-flag">
      <h4 id="x2-3-4-omit-graph-flag"><span class="secno">2.3.4 </span>Omit graph flag&nbsp;<span class="permalink"><a href="#omit-graph-flag" aria-label="Permalink for 2.3.4 Omit graph flag" title="Permalink for 2.3.4 Omit graph flag"><span>§</span></a></span></h4>
      <p>The <a href="#dfn-omit-graph-flag" class="internalDFN" data-link-type="dfn">omit graph flag</a> determines if framed output containing a single
        <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a> is contained within <code>@graph</code>, or not.
        The initial value for the <a href="#dfn-omit-graph-flag" class="internalDFN" data-link-type="dfn">omit graph flag</a> is set using the
        <a data-link-for="JsonLdOptions" href="#dom-jsonldoptions-omitgraph" class="internalDFN" data-link-type="dfn"><code>omitGraph</code></a> option, or based on
        the <a href="#dfn-processing-mode" class="internalDFN" data-link-type="dfn">processing mode</a>; if <a href="#dfn-processing-mode" class="internalDFN" data-link-type="dfn">processing mode</a> is <code>json-ld-1.0</code>, the output
        always includes a <code>@graph</code> member, otherwise, the <code>@graph</code> member is used only
        to describe multiple <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node objects</a>, consistent with compaction.
        See <a href="#framing-algorithm" class="sectionRef sec-ref">section <span class="secno">4.2.2</span> <span class="sec-title">Framing Algorithm</span></a> for a further discussion.</p>
    </section>

    <section id="require-all-flag">
      <h4 id="x2-3-5-require-all-flag"><span class="secno">2.3.5 </span>Require all flag&nbsp;<span class="permalink"><a href="#require-all-flag" aria-label="Permalink for 2.3.5 Require all flag" title="Permalink for 2.3.5 Require all flag"><span>§</span></a></span></h4>
      <p>The <a href="#dfn-require-all-flag" class="internalDFN" data-link-type="dfn">require all flag</a> is used in frame matching to determine when a
        <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a> from an input document matches a frame. When
        matching, an object may include <code>@type</code> and other
        properties, a match is made when <em>any</em> property value in the
        object matches the <a href="#dfn-node-pattern" class="internalDFN" data-link-type="dfn"><code>node pattern</code></a> in the <a href="#dfn-frame-object" class="internalDFN" data-link-type="dfn">frame object</a> if
        the value of the <a href="#dfn-require-all-flag" class="internalDFN" data-link-type="dfn">require all flag</a> is <code>false</code> (the
        default). If the flag value is <code>true</code>, then <em>all</em>
        properties in the <a href="#dfn-frame-object" class="internalDFN" data-link-type="dfn">frame object</a> must be present in the <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node
        object</a> for the node to match.</p>
    </section>
  </section>

  <section id="reverse-framing">
    <h3 id="x2-4-reverse-framing"><span class="secno">2.4 </span>Reverse Framing&nbsp;<span class="permalink"><a href="#reverse-framing" aria-label="Permalink for 2.4 Reverse Framing" title="Permalink for 2.4 Reverse Framing"><span>§</span></a></span></h3>
    <p>A frame may include @reverse, or a value of a term defined using @reverse
      to invert the relationships in the output object. For example, the
      Library example can be inverted using the following frame:</p>

    <div class="example"><div class="example-title marker"><span>Example 13</span><span style="text-transform: none">: Inverted library frame</span></div><pre class="nohighlight">{
  "@context": {
    "@vocab": "http://example.org/",
    <span class="hl-bold">"within": {"@reverse": "contains"}</span>
  },
  <span class="hl-bold">"@type": "Chapter",
  "within": {
    "@type": "Book",
    "within": {
      "@type": "Library"
    }
  }</span>
}</pre></div>

    <p>Using the flattened library example above, results in the following:</p>

    <div class="example"><div class="example-title marker"><span>Example 14</span><span style="text-transform: none">: Inverted library output</span></div><pre class="nohighlight">{
  "@context": {
    "@vocab": "http://example.org/",
    "within": {"@reverse": "contains"}
  },
  "@graph": [{
    "@id": "http://example.org/library/the-republic#introduction",
    "@type": "Chapter",
    "description": "An introductory chapter on The Republic.",
    "title": "The Introduction",
    "within": {
      "@id": "http://example.org/library/the-republic",
      "@type": "Book",
      "contains": {"@id": "http://example.org/library/the-republic#introduction"},
      "creator": "Plato",
      "title": "The Republic",
      "within": {
        "@id": "http://example.org/library",
        "@type": "Library",
        "contains": {"@id": "http://example.org/library/the-republic"}
      }
    }
  }]
}</pre></div>
  </section>

  <section class="changed" id="framing-named-graphs">
    <h3 id="x2-5-framing-named-graphs"><span class="secno">2.5 </span>Framing Named Graphs&nbsp;<span class="permalink"><a href="#framing-named-graphs" aria-label="Permalink for 2.5 Framing Named Graphs" title="Permalink for 2.5 Framing Named Graphs"><span>§</span></a></span></h3>
    <p>Frames can include <code>@graph</code>, which allows information from <a href="#dfn-named-graphs" class="internalDFN" data-link-type="dfn">named graphs</a>
      contained within a <a href="#dfn-json-ld-documents" class="internalDFN" data-link-type="dfn">JSON-LD document</a> to be exposed within it's proper
      graph context. By default, framing uses a <var>merged graph</var>, composed of all
      the <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node objects</a> across all graphs within the input. By using <code>@graph</code>
      within a frame, the output document can include information specifically
      from <a href="#dfn-named-graphs" class="internalDFN" data-link-type="dfn">named graphs</a> contained within the input document.</p>

    <p>The following example uses a variation on our library theme where information
      is split between the <a href="#dfn-default-graph" class="internalDFN" data-link-type="dfn">default graph</a>, and a graph named <code>http://example.org/graphs/books</code>:</p>

    <div class="example"><div class="example-title marker"><span>Example 15</span><span style="text-transform: none">: Frame with named graphs</span></div><pre class="nohighlight">{
  "@context": {"@vocab": "http://example.org/"},
  "@type": "Library",
  "contains": {
    "@id": "http://example.org/graphs/books",
    <span class="hl-bold">"@graph": {
      "@type": "Book"
    }</span>
  }
}</pre></div>

    <div class="example"><div class="example-title marker"><span>Example 16</span><span style="text-transform: none">: Flattened Input with named graphs</span></div><pre class="nohighlight">[{
  "@context": {"@vocab": "http://example.org/"},
  "@id": "http://example.org/graphs/books",
  "@graph": [{
    "@id": "http://example.org/library/the-republic",
    "@type": "http://example.org/Book",
    "http://example.org/contains": {
      "@id": "http://example.org/library/the-republic#introduction"
    },
    "http://example.org/creator": "Plato",
    "http://example.org/title": "The Republic"
  }, {
    "@id": "http://example.org/library/the-republic#introduction",
    "@type": "http://example.org/Chapter",
    "http://example.org/description": "An introductory chapter on The Republic.",
    "http://example.org/title": "The Introduction"
  }]
}, {
  "@context": {"@vocab": "http://example.org/"},
  "@id": "http://example.org/library",
  "@type": "http://example.org/Library",
  "http://example.org/contains": {"@id": "http://example.org/graphs/books"},
  "http://example.org/name": "Library"
}]</pre></div>

    <div class="example"><div class="example-title marker"><span>Example 17</span><span style="text-transform: none">: Framed output with named graphs</span></div><pre class="nohighlight">{
  "@context": {"@vocab": "http://example.org/"},
  "@graph": [{
    "@id": "http://example.org/library",
    "@type": "Library",
    "name": "Library",
    "contains": {
      <span class="hl-bold">"@id": "http://example.org/graphs/books",
      "@graph": [{</span>
        "@id": "http://example.org/library/the-republic",
        "@type": "Book",
        "creator": "Plato",
        "title": "The Republic",
        "contains": {
          "@id": "http://example.org/library/the-republic#introduction",
          "@type": "Chapter",
          "description": "An introductory chapter on The Republic.",
          "title": "The Introduction"
        }
      <span class="hl-bold">}]</span>
    }
  }]
}</pre></div>

  </section>
</section>

<section id="conformance"><!--OddPage--><h2 id="x3-conformance"><span class="secno">3. </span>Conformance&nbsp;<span class="permalink"><a href="#conformance" aria-label="Permalink for 3. Conformance" title="Permalink for 3. Conformance"><span>§</span></a></span></h2><p>
  As well as sections marked as non-normative, all authoring guidelines, diagrams, examples,
  and notes in this specification are non-normative. Everything else in this specification is
  normative.
</p><p id="respecRFC2119">The key words  <em class="rfc2119">MAY</em>, <em class="rfc2119">MUST</em>, <em class="rfc2119">MUST NOT</em>, <em class="rfc2119">RECOMMENDED</em>, and <em class="rfc2119">SHOULD NOT</em> are
  to be interpreted as described in [<cite><a class="bibref" href="#bib-RFC2119">RFC2119</a></cite>].
</p>
  <p>There is one class of products that can claim conformance to this
    specification: <a href="#dfn-json-ld-processors" class="internalDFN" data-link-type="dfn">JSON-LD Processors</a>.</p>

  <p>A conforming <a href="#dfn-json-ld-processors" class="internalDFN" data-link-type="dfn">JSON-LD Processor</a> is a system which can perform the
    <a href="#framing-algorithm">Framing</a> operation in a manner consistent with
    the algorithms defined in this specification.</p>

  <p><a href="#dfn-json-ld-processors" class="internalDFN" data-link-type="dfn">JSON-LD Processors</a> <em class="rfc2119" title="MUST NOT">MUST NOT</em>
    attempt to correct malformed <a href="#dfn-iris" class="internalDFN" data-link-type="dfn">IRIs</a> or language tags;
    however, they <em class="rfc2119" title="MAY">MAY</em> issue validation warnings. IRIs are not modified other
    than conversion between <a data-lt="relative IRI" href="#dfn-relative-iris" class="internalDFN" data-link-type="dfn">relative</a> and
    <a href="#dfn-absolute-iris" class="internalDFN" data-link-type="dfn">absolute IRIs</a>.</p>

  <p>The algorithms in this specification are generally written with more concern for clarity
    than efficiency. Thus, <a href="#dfn-json-ld-processors" class="internalDFN" data-link-type="dfn">JSON-LD Processors</a> <em class="rfc2119" title="MAY">MAY</em>
    implement the algorithms given in this specification in any way desired,
    so long as the end result is indistinguishable from the result that would
    be obtained by the specification's algorithms.</p>

  <p>In algorithm steps that describe operations on <a href="#dfn-keywords" class="internalDFN" data-link-type="dfn">keywords</a>, those steps
    also apply to <a href="#dfn-keywords" class="internalDFN" data-link-type="dfn">keyword</a> aliases.</p>

  <div class="note" id="issue-container-generatedID-2"><div role="heading" class="note-title marker" id="h-note-2" aria-level="3"><span>Note</span></div><p class="">Implementers can partially check their level of conformance to
    this specification by successfully passing the test cases of the JSON-LD test
    suite [<cite><a class="bibref" href="#bib-JSON-LD-TESTS">JSON-LD-TESTS</a></cite>]. Note, however, that passing all the tests in the test
    suite does not imply complete conformance to this specification. It only implies
    that the implementation conforms to aspects tested by the test suite.</p></div>
</section> <!-- end of Conformance section -->

<section id="framing-algorithms">
<!--OddPage--><h2 id="x4-framing-algorithms"><span class="secno">4. </span>Framing Algorithms&nbsp;<span class="permalink"><a href="#framing-algorithms" aria-label="Permalink for 4. Framing Algorithms" title="Permalink for 4. Framing Algorithms"><span>§</span></a></span></h2>

<p>All algorithms described in this section are intended to operate on
  language-native data structures. That is, the serialization to a text-based
  JSON document isn't required as input or output to any of these algorithms.</p>

<p>Reference to JSON data structures are interpreted using their <em>internal representation</em> for the purpose
  of describing algorithms.</p>

<section id="framing-keywords">
  <h3 id="x4-1-syntax-tokens-and-keywords"><span class="secno">4.1 </span>Syntax Tokens and Keywords&nbsp;<span class="permalink"><a href="#framing-keywords" aria-label="Permalink for 4.1 Syntax Tokens and Keywords" title="Permalink for 4.1 Syntax Tokens and Keywords"><span>§</span></a></span></h3>

  <p>This specification adds a number of <a href="#dfn-keywords" class="internalDFN" data-link-type="dfn">keywords</a> (<dfn data-dfn-type="dfn" id="dfn-framing-keywords">framing keywords</dfn>) to
    the ones defined in the JSON-LD 1.1 Syntax specification [<cite><a class="bibref" href="#bib-JSON-LD11CG">JSON-LD11CG</a></cite>]:</p>

  <dl data-sort=""><dt><code>@default</code></dt>
    <dd>Used in <a href="#framing">Framing</a> to set the default value for
      an output property when the framed <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a> does not include such a property.</dd>
    <dt><code>@embed</code></dt>
    <dd>Used in <a href="#framing">Framing</a> to override the
      value of <a href="#dfn-object-embed-flag" class="internalDFN" data-link-type="dfn">object embed flag</a> within a specific frame. Valid values for
      <code>@embed</code> as the following:
      <dl data-sort="">
        <dt><code>@always</code></dt><dd>
          Always embed <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node objects</a> as property values, unless this would
          cause a circular reference.
        </dd>
        <dt><code>@last</code></dt><dd>
          Only the last value within a given <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a> should be embedded,
          previous values of other properties use a <a href="#dfn-node-references" class="internalDFN" data-link-type="dfn">node reference</a>. This is the
          default value if neither <code>@embed</code> nor <a href="#dfn-object-embed-flag" class="internalDFN" data-link-type="dfn">object embed flag</a>
          is not specified.
        </dd>
        <dt><code>@never</code></dt><dd>
          Always use a <a href="#dfn-node-references" class="internalDFN" data-link-type="dfn">node reference</a> when serializing matching values.
        </dd>
        <dt><code>true</code></dt><dd>(equivalent to <code>@last</code>).</dd>
        <dt><code>false</code></dt><dd>(equivalent to <code>@never</code>).</dd>
      </dl>
      <p>Any other value for <code>@embed</code> is invalid and indicates that an
        <a data-link-for="JsonLdFramingErrorCode" href="#dom-jsonldframingerrorcode-invalid--embed-value" class="internalDFN" data-link-type="dfn"><code>invalid @embed value</code></a>
        error has been detected and processing is aborted.</p>
    </dd>
    <dt><code>@explicit</code></dt>
    <dd>Used in <a href="#framing">Framing</a> to override the
      value of <a href="#dfn-explicit-inclusion-flag" class="internalDFN" data-link-type="dfn">explicit inclusion flag</a> within a specific frame.</dd>
    <dt><code>@null</code></dt>
    <dd>Used in <a href="#framing">Framing</a> when a value of <code>null</code>
      should be returned, which would otherwise be removed when
      <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#compaction">Compacting</a>.</dd>
    <dt><code>@omitDefault</code></dt>
    <dd>Used in <a href="#framing">Framing</a> to override the
      value of <a href="#dfn-omit-default-flag" class="internalDFN" data-link-type="dfn">omit default flag</a> within a specific frame.
      <div class="issue" id="issue-container-generatedID-3"><div role="heading" class="issue-title marker" id="h-issue" aria-level="4"><span>Issue</span></div><div class="">Is this flag really useful? Easier to simply not have a default value,
        if it shouldn't match.</div></div>
    </dd>
    <dt class="changed"><code>@requireAll</code></dt>
    <dd class="changed">Used in <a href="#framing">Framing</a> to override the
      value of <a href="#dfn-require-all-flag" class="internalDFN" data-link-type="dfn">require all flag</a> within a specific frame.</dd></dl>

  <p>All JSON-LD tokens and keywords are case-sensitive.</p>
</section>

<section id="framing-0">
<h3 id="x4-2-framing"><span class="secno">4.2 </span>Framing&nbsp;<span class="permalink"><a href="#framing-0" aria-label="Permalink for 4.2 Framing" title="Permalink for 4.2 Framing"><span>§</span></a></span></h3>
<p>Framing is the process of taking a JSON-LD document, which expresses a
  graph of information, and applying a specific graph layout
  (called a <a href="#dfn-json-ld-frame" class="internalDFN" data-link-type="dfn">Frame</a>).</p>

<p>Framing makes use of the <a href="https://json-ld.org/spec/FCGS/json-ld-api/20180607/#node-map-generation">Node Map Generation</a> algorithm
  to place each object defined in the JSON-LD document into a <a href="#dfn-map-of-flattened-subjects" class="internalDFN" data-link-type="dfn">map of flattened subjects</a>, allowing
  them to be operated upon by the <a href="#framing-algorithm">Framing algorithm</a>.</p>

<section id="framing-requirements">
<h4 id="x4-2-1-framing-requirements"><span class="secno">4.2.1 </span>Framing Requirements&nbsp;<span class="permalink"><a href="#framing-requirements" aria-label="Permalink for 4.2.1 Framing Requirements" title="Permalink for 4.2.1 Framing Requirements"><span>§</span></a></span></h4>
<p>A valid <a href="#dfn-json-ld-frame" class="internalDFN" data-link-type="dfn">JSON-LD Frame</a> is a superset of a valid <a href="#dfn-json-ld-documents" class="internalDFN" data-link-type="dfn">JSON-LD document</a>,
  allowing additional content, which is preserved through expansion.
  The <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld/#json-ld-grammar">Grammar</a> defined in the JSON-LD 1.1 Syntax specification [<cite><a class="bibref" href="#bib-JSON-LD11CG">JSON-LD11CG</a></cite>]
  is extended as follows:</p>
  <ul>
    <li>Framing adds <a href="#dfn-framing-keywords" class="internalDFN" data-link-type="dfn">framing keywords</a> which may be used as keys of a <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a>, which <em class="rfc2119" title="MUST">MUST</em> be preserved when expanding.
    </li><li>Values of keys in a <a href="#dfn-frame-object" class="internalDFN" data-link-type="dfn">frame object</a> that are not <a href="#dfn-keywords" class="internalDFN" data-link-type="dfn">keyword</a> <em class="rfc2119" title="MAY">MAY</em> also include a <a href="#dfn-default-object" class="internalDFN" data-link-type="dfn">default object</a>.
      Values of <code>@default</code> <em class="rfc2119" title="MAY">MAY</em> include the value <code>@null</code>,
      or an <a href="#dfn-arrays" class="internalDFN" data-link-type="dfn">array</a> containing only <code>@null</code>, in addition to other values
      allowed in the grammar for values of keys expanding to <a href="#dfn-absolute-iris" class="internalDFN" data-link-type="dfn">absolute IRIs</a>.
      <a href="#dfn-json-ld-processors" class="internalDFN" data-link-type="dfn">Processors</a> <em class="rfc2119" title="MUST">MUST</em> preserve this value when expanding. All other key/value pairs of
      a <a href="#dfn-default-object" class="internalDFN" data-link-type="dfn">default object</a> <em class="rfc2119" title="MUST">MUST</em> be ignored.</li>
    <li>The values of <code>@id</code> and <code>@type</code> may also be an empty <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a>, or an <a href="#dfn-arrays" class="internalDFN" data-link-type="dfn">array</a>
      containing only an empty <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a>.
      <a href="#dfn-json-ld-processors" class="internalDFN" data-link-type="dfn">Processors</a> <em class="rfc2119" title="MUST">MUST</em> preserve this value when expanding.</li>
    <li>Framing either operates on the merged node definitions contained in
      the input document, or on the <a href="#dfn-default-graph" class="internalDFN" data-link-type="dfn">default graph</a> depending on if the
      input frame contains the <code>@graph</code> key at the top level.
      Nodes with a <a href="#dfn-subjects" class="internalDFN" data-link-type="dfn">subject</a> that is also a <a href="#dfn-named-graphs" class="internalDFN" data-link-type="dfn">named graph</a>, where
      the <a href="#dfn-frame-object" class="internalDFN" data-link-type="dfn">frame object</a> contains <code>@graph</code>, extend framing
      to <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node objects</a> from the associated <a href="#dfn-named-graphs" class="internalDFN" data-link-type="dfn">named graph</a>.</li>
  </ul>
</section>

<section class="algorithm" id="framing-algorithm">
<h4 id="x4-2-2-framing-algorithm"><span class="secno">4.2.2 </span>Framing Algorithm&nbsp;<span class="permalink"><a href="#framing-algorithm" aria-label="Permalink for 4.2.2 Framing Algorithm" title="Permalink for 4.2.2 Framing Algorithm"><span>§</span></a></span></h4>

<p>The framing algorithm takes an <a href="#dfn-json-ld-input" class="internalDFN" data-link-type="dfn">JSON-LD input</a> (<var>expanded input</var>),
  which  <em class="rfc2119" title="MUST">MUST</em> be a <a href="#dfn-json-ld-documents" class="internalDFN" data-link-type="dfn">JSON-LD document</a> in
  <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dfn-expanded-form">expanded form</a>,
  an <a href="#dfn-input-frame" class="internalDFN" data-link-type="dfn">input frame</a> (<var>expanded frame</var>),
  which  <em class="rfc2119" title="MUST">MUST</em> be a <a href="#dfn-json-ld-frame" class="internalDFN" data-link-type="dfn">JSON-LD frame</a> in
  <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dfn-expanded-form">expanded form</a>,
  a <a href="#dfn-contexts" class="internalDFN" data-link-type="dfn">context</a> (<var>context</var>),
  and a number of <a data-lt="JsonLdProcessor-frame-options" href="#dfn-jsonldprocessor-frame-options" class="internalDFN" data-link-type="dfn">options</a> and produces <a href="#dfn-json-ld-output" class="internalDFN" data-link-type="dfn">JSON-LD output</a>.</p>

<p>If an error is detected in the <var>expanded frame</var>, a <a data-link-for="JsonLdFramingErrorCode" href="#dom-jsonldframingerrorcode-invalid-frame" class="internalDFN" data-link-type="dfn"><code>invalid frame</code></a>
  error has been detected and processing is aborted.
  <span class="ednote">Need more specifics as to what constitutes a valid frame.</span></p>

<p class="changed">Set <var>graph map</var> to the result of performing the
  <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#node-map-generation">Node Map Generation</a> algorithm on
  <var>expanded input</var>.</p>

<p class="changed">If the <a data-link-for="JsonLdOptions" href="#dom-jsonldoptions-framedefault" class="internalDFN" data-link-type="dfn"><code>frameDefault</code></a> option
  is present with the value <code>true</code>, set <var>graph name</var> to <code>@default</code>.
  Otherwise, create <var>merged node map</var> using the <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#merge-node-maps">Merge Node Maps</a> algorithm
  with <var>graph map</var> and add <var>merged node map</var> as the value of <code>@merged</code>
  in <var>graph map</var> and set <var>graph name</var> to <code>@merged</code>.</p>

<p>The recursive algorithm operates with a <a href="#dfn-framing-state" class="internalDFN" data-link-type="dfn">framing state</a> (<var>state</var>),
  created initially using
  the <a href="#dfn-object-embed-flag" class="internalDFN" data-link-type="dfn">object embed flag</a> set to <code>true</code>,
  the <a href="#dfn-explicit-inclusion-flag" class="internalDFN" data-link-type="dfn">explicit inclusion flag</a> set to <code>false</code>,
  the <a href="#dfn-require-all-flag" class="internalDFN" data-link-type="dfn">require all flag</a> set to <code>true</code>,
  the <a href="#dfn-omit-default-flag" class="internalDFN" data-link-type="dfn">omit default flag</a> set to <code>false</code>,
  <var>graph map</var>, <var>graph name</var>,
  along with <a href="#dfn-map-of-flattened-subjects" class="internalDFN" data-link-type="dfn">map of flattened subjects</a>
  set to the property associated with <var>graph name</var> in <var>graph map</var>, and
  <var>graph stack</var> set to an empty <a href="#dfn-arrays" class="internalDFN" data-link-type="dfn">array</a>. The initial values of the
  <a href="#dfn-object-embed-flag" class="internalDFN" data-link-type="dfn">object embed flag</a>, <a href="#dfn-require-all-flag" class="internalDFN" data-link-type="dfn">require all flag</a>, and <a href="#dfn-omit-default-flag" class="internalDFN" data-link-type="dfn">omit default flag</a>
  <em class="rfc2119" title="MUST">MUST</em> be overridden by values set in <a data-lt="JsonLdProcessor-frame-options" href="#dfn-jsonldprocessor-frame-options" class="internalDFN" data-link-type="dfn">options</a>.
  Also initialize <var>results</var> as an empty <a href="#dfn-arrays" class="internalDFN" data-link-type="dfn">array</a>.</p>

<div class="note" id="issue-container-generatedID-4"><div role="heading" class="note-title marker" id="h-note-3" aria-level="5"><span>Note</span></div><p class=""><a href="#dfn-json-ld-processors" class="internalDFN" data-link-type="dfn">Processors</a> <em class="rfc2119" title="MAY">MAY</em> use other runtime options to set different <a href="#dfn-framing-state" class="internalDFN" data-link-type="dfn">framing state</a> defaults
  for values of <var>state</var>.</p></div>

<p>Invoke the recursive algorithm using <a href="#dfn-framing-state" class="internalDFN" data-link-type="dfn">framing state</a> (<var>state</var>),
  the keys from the <a href="#dfn-map-of-flattened-subjects" class="internalDFN" data-link-type="dfn">map of flattened subjects</a> as <var>subjects</var>,
  <var>expanded frame</var> (<var>frame</var>), <var>result</var> as <var>parent</var>, and
  <code>null</code> as <var>active property</var>.</p>

<p>The recursive algorithm adds elements to <var>parent</var> either by appending
  the element to <var>parent</var>, if it is an <a href="#dfn-arrays" class="internalDFN" data-link-type="dfn">array</a>, or by appending it
  to an array associated with <var>active property</var> in <var>parent</var>, if it is a <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a>.
  Note that if <var>parent</var> is an <a href="#dfn-arrays" class="internalDFN" data-link-type="dfn">array</a>, <var>active property</var> <em class="rfc2119" title="MUST">MUST</em> be <code>null</code>,
  and if it is a <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a>, it <em class="rfc2119" title="MUST NOT">MUST NOT</em> be <code>null</code>.</p>

<p>The following series of steps is the recursive
  portion of the framing algorithm:</p>

<ol>
  <li>If <var>frame</var> is an <a href="#dfn-arrays" class="internalDFN" data-link-type="dfn">array</a>, set <var>frame</var> to the first member of the <a href="#dfn-arrays" class="internalDFN" data-link-type="dfn">array</a>, which <em class="rfc2119" title="MUST">MUST</em> be a valid <a href="#dfn-json-ld-frame" class="internalDFN" data-link-type="dfn">frame</a>.</li>
  <li>Initialize flags <var>embed</var>, <var>explicit</var>, and <var>requireAll</var> from
    <a href="#dfn-object-embed-flag" class="internalDFN" data-link-type="dfn">object embed flag</a>, <a href="#dfn-explicit-inclusion-flag" class="internalDFN" data-link-type="dfn">explicit inclusion flag</a>, and
    <a href="#dfn-require-all-flag" class="internalDFN" data-link-type="dfn">require all flag</a> in <var>state</var> overriding from any property values
    for <code>@embed</code>, <code>@explicit</code>, and <code>@requireAll</code> in <var>frame</var>.</li>
  <li>Create a list of matched subjects by filtering <var>subjects</var> against <var>frame</var>
    using the <a href="#frame-matching">Frame Matching algorithm</a>
    with <var>state</var>, <var>subjects</var>, <var>frame</var>, and <var>requireAll</var>.</li>
  <li>For each <var>id</var> and associated <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a> <var>node</var>
    from the set of matched subjects, ordered by <var>id</var>:
    <div class="ednote" id="issue-container-generatedID-5"><div role="heading" class="ednote-title marker" id="h-ednote" aria-level="5"><span>Editor's note</span></div><p class="">Can we remove sorting, or make it subject to a processing
      flag? In general, sorting is a performance problem for JSON-LD, and
      inhibits stream processing.</p></div>
    <ol>
      <li>Initialize <var>output</var> to a new <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a> with <code>@id</code> and <var>id</var>.</li>
      <li>Otherwise, if <var>embed</var> is <code>@never</code> or if a
        circular reference would be created by an embed,
        add <var>output</var> to <var>parent</var>
        and do not perform additional processing for this <var>node</var>.</li>
      <li>Otherwise, if <var>embed</var> is <code>@last</code>,
        remove any existing embedded node from <var>parent</var> associate with
        <var>graph name</var> in <var>state</var>.
        <span class="ednote">Requires sorting of subjects. We could consider <code>@sample</code>, to embed
          just the first matched node. With sorting, we could also consider <code>@first</code>.</span></li>
      <li>If <var>embed</var> is <code>@last</code> or <code>@always</code>
        <ol>
          <li class="changed">If <var>graph map</var> in <var>state</var> has an entry for <var>id</var>:
            <ol>
              <li>If <var>frame</var> does not have the key <code>@graph</code>,
                set <var>recurse</var> to <code>true</code>, unless <var>graph name</var> in <var>state</var> is <code>@merged</code>
                and set <var>subframe</var> to a new empty <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a>.</li>
              <li>Otherwise, set <var>subframe</var> to the first entry for <code>@graph</code> in <var>frame</var>,
                or a new empty <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a>, if it does not exist, and
                set <var>recurse</var> to <code>true</code>, unless <var>id</var>
                is <code>@merged</code> or <code>@default</code>.</li>
              <li>If <var>recurse</var> is <code>true</code>:
                <ol>
                  <li>Push <var>graph name</var> from <var>state</var> onto <var>graph stack</var>
                  in <var>state</var>.</li>
                  <li>Set the value of <var>graph name</var> in <var>state</var> to <var>id</var>.</li>
                  <li>Invoke the recursive algorithm using <var>state</var>,
                    the keys from the <var>graph map</var> in <var>state</var> associated with id as <var>subjects</var>,
                    <var>subframe</var> as <var>frame</var>,
                    <var>output</var> as <var>parent</var>, and <code>@graph</code> as <var>active property</var>.
                  </li><li>Pop the value from <var>graph stack</var> in <var>state</var> and set <var>graph name</var> in <var>state</var>
                    back to that value.</li>
                </ol>
              </li>
            </ol>
          </li>
          <li>For each <var>property</var> and <var>objects</var> in <var>node</var>, ordered by <var>property</var>:
            <ol>
              <li>If <var>property</var> is a <a href="#dfn-keywords" class="internalDFN" data-link-type="dfn">keyword</a>, add <var>property</var> and <var>objects</var>
                to <var>output</var>.</li>
              <li>Otherwise, if <var>property</var> is not in <var>frame</var>, and <var>explicit</var> is <code>true</code>,
                <a href="#dfn-json-ld-processors" class="internalDFN" data-link-type="dfn">processors</a> <em class="rfc2119" title="MUST NOT">MUST NOT</em> add any values for <var>property</var> to <var>output</var>, and the following
                steps are skipped.</li>
              <li>For each <var>item</var> in <var>objects</var>:
                <ol>
                  <li>If <var>item</var> is a <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a> with the property <code>@list</code>, then each
                    <var>listitem</var> in the list is processed in sequence and added to a new list <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a>
                    in output:
                    <ol>
                      <li>If <var>listitem</var> is a <a href="#dfn-node-references" class="internalDFN" data-link-type="dfn">node reference</a>,
                        invoke the recursive algorithm using <var>state</var>,
                        the value of <code>@id</code> from <var>listitem</var>
                        as the sole member of a new <var>subjects</var> <a href="#dfn-arrays" class="internalDFN" data-link-type="dfn">array</a>,
                        the first value from <code>@list</code> in <var>frame</var> as <var>frame</var>,
                        <var>list</var> as <var>parent</var>, and <code>@list</code> as <var>active property</var>.
                        If <var>frame</var> does not exist, create a new <var>frame</var> using a new <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a>
                        with properties for <code>@embed</code>, <code>@explicit</code> and <code>@requireAll</code>
                        taken from <var>embed</var>, <var>explicit</var> and <var>requireAll</var>.
                        <span class="ednote">Could this use the <var>list</var> <a href="#dfn-arrays" class="internalDFN" data-link-type="dfn">array</a>, and <code>null</code> for <var>active property</var>?</span></li>
                      <li>Otherwise, append a copy of <var>listitem</var> to <code>@list</code> in <var>list</var>.</li>
                    </ol>
                  </li>
                  <li>If <var>item</var> is a <a href="#dfn-node-references" class="internalDFN" data-link-type="dfn">node reference</a>,
                    invoke the recursive algorithm using <var>state</var>,
                    the value of <code>@id</code> from <var>item</var>
                    as the sole member of a new <var>subjects</var> <a href="#dfn-arrays" class="internalDFN" data-link-type="dfn">array</a>,
                    the first value from <var>property</var> in <var>frame</var> as <var>frame</var>,
                    <var>output</var> as <var>parent</var>, and <var>property</var> as <var>active property</var>.
                    If <var>frame</var> does not exist, create a new <var>frame</var> using a new <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a>
                    with properties for <code>@embed</code>, <code>@explicit</code> and <code>@requireAll</code>
                    taken from <var>embed</var>, <var>explicit</var> and <var>requireAll</var>.</li>
                  <li>Otherwise, append a copy of <var>item</var> to <a href="#dfn-active-property" class="internalDFN" data-link-type="dfn">active property</a> in
                    <var>output</var>.</li>
                </ol>
              </li>
            </ol>
          </li>

          <li>For each non-<a href="#dfn-keywords" class="internalDFN" data-link-type="dfn">keyword</a> <var>property</var> and <var>objects</var> in <var>frame</var> that is not in <var>output</var>:
            <ol>
              <li>Let <var>item</var> be the first element in <var>objects</var>, which <em class="rfc2119" title="MUST">MUST</em> be a <a href="#dfn-frame-object" class="internalDFN" data-link-type="dfn">frame object</a>.</li>
              <li>Set <var>property frame</var> to the first item in <var>objects</var> or a newly created <a href="#dfn-frame-object" class="internalDFN" data-link-type="dfn">frame object</a> if value is <var>objects</var>.
                <var>property frame</var> <em class="rfc2119" title="MUST">MUST</em> be a dictionary.</li>
              <li>Skip <var>property</var> and <var>property frame</var> if <var>property frame</var> contains
                <code>@omitDefault</code> with a value of <code>true</code>,
                or does not contain <code>@omitDefault</code> and the value of
                the <a href="#dfn-omit-default-flag" class="internalDFN" data-link-type="dfn">omit default flag</a> is <code>true</code>.</li>
              <li>Add <var>property</var> to <var>output</var> with a
                new <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a> having a property <code>@preserve</code> and
                a value that is a copy of the value of <code>@default</code> in
                <var>frame</var> if it exists, or the string <code>@null</code>
                otherwise.</li>
            </ol>
          </li>

          <li class="changed">If <var>frame</var> has the property <code>@reverse</code>, then
            for each <var>reverse property</var> and <var>sub frame</var> that are the values of <code>@reverse</code> in <var>frame</var>:
            <ol>
              <li>Create a <code>@reverse</code> property in <var>output</var> with a new <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a> <var>reverse dict</var> as its value.</li>
              <li>For each <var>reverse id</var> and <var>node</var> in the <a href="#dfn-map-of-flattened-subjects" class="internalDFN" data-link-type="dfn">map of flattened subjects</a> that has the property
                <var>reverse property</var> containing a <a href="#dfn-node-references" class="internalDFN" data-link-type="dfn">node reference</a> with an <code>@id</code> of <var>id</var>:
                <ol>
                  <li>Add <var>reverse property</var> to <var>reverse dict</var> with a new empty <a href="#dfn-arrays" class="internalDFN" data-link-type="dfn">array</a> as its value.</li>
                  <li>Invoke the recursive algorithm using <var>state</var>,
                    the <var>reverse id</var>
                    as the sole member of a new <var>subjects</var> <a href="#dfn-arrays" class="internalDFN" data-link-type="dfn">array</a>,
                    <var>sub frame</var> as <var>frame</var>,
                    <code>null</code> as <var>active property</var>,
                    and the <a href="#dfn-arrays" class="internalDFN" data-link-type="dfn">array</a> value of <var>reverse property</var> in <var>reverse dict</var> as <var>parent</var>.</li>
                </ol>
              </li>
            </ol>
          </li>

          <li>Once output has been set are required in the previous steps,
            add <var>output</var> to <var>parent</var>.</li>
        </ol>
      </li>
    </ol>
  </li>
</ol>

<p class="changed">If the <a href="#dfn-processing-mode" class="internalDFN" data-link-type="dfn">processing mode</a> is <code>json-ld-1.1</code>,
  remove the <code>@id</code> member of each <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a> where the
  member value is a <a href="#dfn-blank-node-identifiers" class="internalDFN" data-link-type="dfn">blank node identifier</a> which appears only once
  in any property value within <var>result</var>.</p>
<p>Using <var>result</var> from the recursive algorithm, set <var>compacted results</var> to the result of using the
  <code class="idlMemberName"><a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dom-jsonldprocessor-compact">compact</a></code>
  method using <var>results</var>, <a href="#dfn-contexts" class="internalDFN" data-link-type="dfn">context</a>, and
  <a data-lt="JsonLdProcessor-frame-options" href="#dfn-jsonldprocessor-frame-options" class="internalDFN" data-link-type="dfn">options</a>.</p>
<p>If <span class="changed">the <a href="#dfn-omit-graph-flag" class="internalDFN" data-link-type="dfn">omit graph flag</a> is <code>false</code> and</span>
  <var>compacted results</var> does not have a top-level <code>@graph</code> member, or its value is
  not an <a href="#dfn-arrays" class="internalDFN" data-link-type="dfn">array</a>, modify <var>compacted results</var> to place the non <code>@context</code> <a href="#dfn-properties" class="internalDFN" data-link-type="dfn">properties</a>
  of <var>compacted results</var> into a <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a> contained within the array value of
  <code>@graph</code>. If the <a href="#dfn-omit-graph-flag" class="internalDFN" data-link-type="dfn">omit graph flag</a> is <code>true</code>, a
  top-level <code>@graph</code> member is used only to contain multiple <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node objects</a>.</p>
<p>Recursively, replace all key-value pairs in <var>compacted results</var>
  where the key is <code>@preserve</code> with the value from the key-pair.
  If the value from the key-pair is <code>@null</code>, replace the value with <code>null</code>.
  <span class="changed">If, after replacement, an array contains a single array value, replace the array with that value.</span>
  If, after replacement, an array contains only the value <a href="#dfn-null" class="internalDFN" data-link-type="dfn">null</a> remove the value, leaving
  an empty <a href="#dfn-arrays" class="internalDFN" data-link-type="dfn">array</a>.</p>
<p>Return <var>compacted results</var>.</p>

</section>

<section id="frame-matching" class="changed algorithm">
  <h4 id="x4-2-3-frame-matching-algorithm"><span class="secno">4.2.3 </span>Frame Matching Algorithm&nbsp;<span class="permalink"><a href="#frame-matching" aria-label="Permalink for 4.2.3 Frame Matching Algorithm" title="Permalink for 4.2.3 Frame Matching Algorithm"><span>§</span></a></span></h4>

  <p>The Frame Matching Algorithm is used as part of the <a href="#framing-algorithm">Framing algorithm</a>
    to determine if a particular <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a> matches the criteria set in a <a href="#dfn-json-ld-frame" class="internalDFN" data-link-type="dfn">frame</a>.
    In general, a node object matches a frame if it meets the matches on <code>@type</code>,
    or <code>@id</code>,
    or if it matches given one of several different properties (or all properties, if the
    <a href="#dfn-require-all-flag" class="internalDFN" data-link-type="dfn">require all flag</a> is present.).</p>

  <div class="note" id="issue-container-generatedID-6"><div role="heading" class="note-title marker" id="h-note-4" aria-level="5"><span>Note</span></div><p class="">As matching is performed on expanded node objects, all values will be in the form of an array.</p></div>

  <p>Node matching uses a combination of JSON constructs to match <em>any</em>, <em>zero</em>, or <em>some</em> specific values:</p>
  <dl data-sort=""><dt><code>[]</code> (<code><dfn data-dfn-type="dfn" id="dfn-match-none">match none</dfn></code>)</dt>
    <dd>An empty array matches no values, or a value which is, itself, an empty array.</dd>
    <dt><code>[<a href="#dfn-frame-object" class="internalDFN" data-link-type="dfn">frame object</a>]</code> (<code><dfn data-dfn-type="dfn" id="dfn-node-pattern">node pattern</dfn></code>)</dt>
    <dd>A non-empty <a href="#dfn-frame-object" class="internalDFN" data-link-type="dfn">frame object</a>, used to match specific values using recursive node matching.</dd>
    <dt><code>[<a href="#dfn-iris" class="internalDFN" data-link-type="dfn"><abbr title="Internationalized Resource Identifier">IRI</abbr></a>+]</code></dt>
    <dd>One or more strings in the form of an <a href="#dfn-iris" class="internalDFN" data-link-type="dfn"><abbr title="Internationalized Resource Identifier">IRI</abbr></a>, used for matching on <code>@type</code> and <code>@id</code>,
      which allows a match on <em>any</em> of the listed IRIs.</dd>
    <dt><code>[<a href="#dfn-value-objects" class="internalDFN" data-link-type="dfn">value object</a>]</code> (<code><dfn data-dfn-type="dfn" id="dfn-value-pattern">value pattern</dfn></code>)</dt>
    <dd>A <a href="#dfn-value-objects" class="internalDFN" data-link-type="dfn">value object</a>, used to match a specific value. Within a <a href="#dfn-value-objects" class="internalDFN" data-link-type="dfn">value object</a>,
      the values for <code>@value</code>, <code>@type</code>, and <code>@language</code>
      may also be an array of one or more <a href="#dfn-strings" class="internalDFN" data-link-type="dfn">string</a> values.</dd><dt><code>{}</code> (<code><dfn data-dfn-type="dfn" id="dfn-wildcard">wildcard</dfn></code>)</dt>
    <dd>An array containing an empty object
      (after excluding any properties which are <a href="#dfn-framing-keywords" class="internalDFN" data-link-type="dfn">framing keywords</a>)
      matches any value that is present, and does not match if there are no values.</dd>
    </dl>

<p>The frame matching algorithm takes the <a href="#dfn-framing-state" class="internalDFN" data-link-type="dfn">framing state</a> (<var>state</var>),
  a list of subjects to match from the <a href="#dfn-map-of-flattened-subjects" class="internalDFN" data-link-type="dfn">map of flattened subjects</a> (<var>subjects</var>),
  a <a href="#dfn-json-ld-frame" class="internalDFN" data-link-type="dfn">frame</a> to match against (<var>frame</var>), and the <var>requireAll</var> flag
  and returns a list of matched subjects by filtering each <var>node</var> in <var>subjects</var> as follows:</p>

<p>Frame matching follows an order of precedence, first attempting to match on a particular <code>@id</code>, then
  a particular <code>@type</code> (or lack of <code>@type</code>), then by matching on any or all
  of a set of properties, if neither <code>@id</code>, nor <code>@type</code> are in the frame.</p>

<ol>
  <li><var>node</var> matches if it has an <code>@id</code> property value
    which is also a value of the <code>@id</code> property in <var>frame</var>.
    Otherwise, <var>node</var> does not match if <var>frame</var> has a non-empty
    <code>@id</code> property, other than an empty <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a>.
    Otherwise, frame must not have a <code>@id</code> property; continue to the next step.
    <div class="note" id="issue-container-generatedID-7"><div role="heading" class="note-title marker" id="h-note-5" aria-level="5"><span>Note</span></div><div class="">Framing works on <a href="#dfn-map-of-flattened-subjects" class="internalDFN" data-link-type="dfn">map of flattened subjects</a>,
      and the act of flattening ensures that all subjects have an
      <code>@id</code> property; thus the <code>"@id": []</code> pattern would
      never match any <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a>. the <code>"@id": [{}]</code> pattern would
      match any <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a> and is equivalent to not specifying a
      <code>@id</code> property in <var>frame</var> at all</div></div>
  </li>
  <li><var>node</var> matches if frame has no non-<code>keyword</code> properties.</li>
  <li>If <var>requireAll</var> is <strong>true</strong>, <var>node</var> matches if all non-<a href="#dfn-keywords" class="internalDFN" data-link-type="dfn">keyword</a> properties (<var>property</var>) in <var>frame</var> match any of the following conditions.
    Or, if <var>requireAll</var> is <strong>false</strong>, if any of the non-<a href="#dfn-keywords" class="internalDFN" data-link-type="dfn">keyword</a> properties (<var>property</var>) in <var>frame</var> match any of the following conditions.
    For the <var>values</var> of each <var>property</var> from <var>frame</var> in <var>node</var>:
    <ol>
      <li>If <var>property</var> is <code>@type</code>:
        <ol>
          <li><var>property</var> matches if the <code>@type</code> property in frame includes any <a href="#dfn-iris" class="internalDFN" data-link-type="dfn"><abbr title="Internationalized Resource Identifier">IRI</abbr></a> in <var>values</var>.</li>
          <li>Otherwise, <var>property</var> matches if <var>values</var> is not empty and the <code>@type</code> property in <var>frame</var> is <code><a href="#dfn-wildcard" class="internalDFN" data-link-type="dfn"><code>wildcard</code></a></code>.</li>
          <li>Otherwise, <var>property</var> matches if <var>values</var> is empty and the <code>@type</code> property in <var>frame</var> is <code><a href="#dfn-match-none" class="internalDFN" data-link-type="dfn"><code>match none</code></a></code>.</li>
          <li>Otherwise, <var>property</var> does not match.</li>
        </ol>
      </li>
      <li>Otherwise, the value of <var>property</var> in <var>frame</var> <em class="rfc2119" title="MUST">MUST</em> be empty, or an array
        containing a valid <a href="#dfn-json-ld-frame" class="internalDFN" data-link-type="dfn">frame</a>.</li>
      <li><var>property</var> matches if <var>values</var> is empty, or non existent,
        the value of <var>property</var> in <var>frame</var>
        is a <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a> containing only the key <code>@default</code> with any value,
        and any other property in <var>node</var> has a non-default match.</li>
      <li><var>node</var> does not match if <var>values</var> is not empty and the value of <var>property</var> in <var>frame</var> is <code><a href="#dfn-match-none" class="internalDFN" data-link-type="dfn"><code>match none</code></a></code>, and further matching is aborted.</li>
      <li>Otherwise, <var>property</var> matches if <var>values</var> is not empty and the value of <var>property</var> in <var>frame</var> is <code><a href="#dfn-wildcard" class="internalDFN" data-link-type="dfn"><code>wildcard</code></a></code>.</li>
      <li>Otherwise, if the value of <var>property</var> in <var>frame</var> is a <a href="#dfn-value-pattern" class="internalDFN" data-link-type="dfn"><code>value pattern</code></a> (<var>value pattern</var>):
        property matching is determined using the <a href="#value-matching">Value matching algorithm</a>. </li>
      <li>Otherwise, for any <strong>node pattern</strong> (<var>node pattern</var>) which is one of the values of <var>property</var> in <var>frame</var>:
        <ol>
          <li>Let <var>value subjects</var> be the list of subjects from the <a href="#dfn-map-of-flattened-subjects" class="internalDFN" data-link-type="dfn">map of flattened subjects</a> matching the <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a> values from <var>values</var>.</li>
          <li>Let <var>matched subjects</var> be the result of calling this algorithm recursively using
            <var>state</var>, <var>value subjects</var> for <var>subjects</var>, <var>node pattern</var> for <var>frame</var>, and the <var>requireAll</var> flag.</li>
          <li><var>property</var> matches if <var>matched subjects</var> is not empty.</li>
        </ol>
      </li>
      <li>Otherwise, <var>property</var> does not match.</li>
    </ol>
  </li>
</ol>
</section>

<section id="value-matching" class="changed algorithm">
  <h4 id="x4-2-4-value-pattern-matching-algorithm"><span class="secno">4.2.4 </span>Value Pattern Matching Algorithm&nbsp;<span class="permalink"><a href="#value-matching" aria-label="Permalink for 4.2.4 Value Pattern Matching Algorithm" title="Permalink for 4.2.4 Value Pattern Matching Algorithm"><span>§</span></a></span></h4>

  <p>The Value Pattern Matching Algorithm is used as part of the <a href="#framing-algorithm">Framing</a>
    and <a href="#frame-matching">Frame Matching</a> algorithms. A value object
    matches a value pattern using the <code><a href="#dfn-match-none" class="internalDFN" data-link-type="dfn"><code>match none</code></a></code> and <code><a href="#dfn-wildcard" class="internalDFN" data-link-type="dfn"><code>wildcard</code></a></code>
    patterns on <code>@value</code>, <code>@type</code>, and
    <code>@language</code>, in addition to allowing a specific value to match a
    set of values defined using the <a href="#dfn-arrays" class="internalDFN" data-link-type="dfn">array</a> form for each <a href="#dfn-value-objects" class="internalDFN" data-link-type="dfn">value
    object</a> property.</p>

  <p>The algorithm takes a <a href="#dfn-value-pattern" class="internalDFN" data-link-type="dfn"><code>value pattern</code></a> (<var>pattern</var>) and <a href="#dfn-value-objects" class="internalDFN" data-link-type="dfn">value object</a> (<var>value</var>) as parameters.
    Value matches pattern using the following algorithm:</p>

  <ol>
    <li>Let <var>v1</var>, <var>t1</var>, and <var>l1</var> be the values of <code>@value</code>, <code>@type</code>, and <code>@language</code> in <var>value</var>, or <strong>null</strong> if none exists.</li>
    <li>Let <var>v2</var>, <var>t2</var>, and <var>l2</var> be the values of <code>@value</code>, <code>@type</code>, and <code>@language</code> in <var>value pattern</var>, or <strong>null</strong> if none exists.</li>
    <li><var>Value</var> matches <var>pattern</var> when <var>pattern</var> is <code><a href="#dfn-wildcard" class="internalDFN" data-link-type="dfn"><code>wildcard</code></a></code>, or:
      <ol>
        <li><var>v1</var> is in <var>v2</var>, or <var>v1</var> is not <strong>null</strong> and <var>v2</var> is <code><a href="#dfn-wildcard" class="internalDFN" data-link-type="dfn"><code>wildcard</code></a></code>, and</li>
        <li><var>t1</var> is in <var>t2</var>, or <var>t1</var> is not <strong>null</strong> and <var>t2</var> is <code><a href="#dfn-wildcard" class="internalDFN" data-link-type="dfn"><code>wildcard</code></a></code>, or <strong>null</strong>, or <var>t1</var> is <code>null</code> and <var>t2</var> is <strong>null</strong> or <code><a href="#dfn-match-none" class="internalDFN" data-link-type="dfn"><code>match none</code></a></code>, and</li>
        <li><var>l1</var> is in <var>l2</var>, or <var>l1</var> is not <strong>null</strong> and <var>l2</var> is <code><a href="#dfn-wildcard" class="internalDFN" data-link-type="dfn"><code>wildcard</code></a></code>, or <strong>null</strong>, or <var>l1</var> is <code>null</code> and <var>l2</var> is <strong>null</strong> or <code><a href="#dfn-match-none" class="internalDFN" data-link-type="dfn"><code>match none</code></a></code>.</li>
      </ol>
    </li>
  </ol>
</section>

</section>
</section>

<section id="the-application-programming-interface">
  <!--OddPage--><h2 id="x5-the-application-programming-interface"><span class="secno">5. </span>The Application Programming Interface&nbsp;<span class="permalink"><a href="#the-application-programming-interface" aria-label="Permalink for 5. The Application Programming Interface" title="Permalink for 5. The Application Programming Interface"><span>§</span></a></span></h2>

  <p>This API provides a clean mechanism that enables developers to convert
  JSON-LD data into a variety of output formats that are easier to work with in
  various programming languages. If a JSON-LD API is provided in a programming
  environment, the entirety of the following API <em class="rfc2119" title="MUST">MUST</em> be implemented.
  </p>

  <section class="algorithm" id="jsonldprocessor">
    <h3 id="x5-1-jsonldprocessor"><span class="secno">5.1 </span>JsonLdProcessor&nbsp;<span class="permalink"><a href="#jsonldprocessor" aria-label="Permalink for 5.1 JsonLdProcessor" title="Permalink for 5.1 JsonLdProcessor"><span>§</span></a></span></h3>

    <p>The <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dfn-json-ld-processor">JSON-LD Processor</a> interface is the high-level programming structure that developers
      use to access the JSON-LD transformation methods. The definition below is an experimental
      extension of the interface defined in the JSON-LD 1.1 API [<cite><a class="bibref" href="#bib-JSON-LD11CG-API">JSON-LD11CG-API</a></cite>].</p>

    <div><pre class="def idl"><span class="idlInterface" id="idl-def-jsonldprocessor" data-idl="" data-title="JsonLdProcessor">[<span class="idlCtor"><span class="extAttrName"><a href="https://heycam.github.io/webidl/#Constructor">Constructor</a></span></span>]
interface <span class="idlInterfaceID"><a data-no-default="" data-link-for="" data-lt="" href="#dom-jsonldprocessor" class="internalDFN" data-link-type="dfn"><code>JsonLdProcessor</code></a></span> {
<span class="idlMethod" id="idl-def-jsonldprocessor-frame-input-frame-options" data-idl="" data-title="frame" data-dfn-for="jsonldprocessor">    static <span class="idlMethType"><a href="https://heycam.github.io/webidl/#idl-promise">Promise</a>&lt;JsonLdDictionary&gt;</span> <span class="idlMethName"><a data-no-default="" data-link-for="jsonldprocessor" data-lt="frame|frame()" href="#dom-jsonldprocessor-frame" class="internalDFN" data-link-type="dfn"><code>frame</code></a></span>(<span class="idlParam"><span class="idlParamType">JsonLdInput</span> <span class="idlParamName">input</span></span>,
                                           <span class="idlParam"><span class="idlParamType">(JsonLdDictionary or <a href="https://heycam.github.io/webidl/#idl-USVString">USVString</a>)</span> <span class="idlParamName">frame</span></span>,
                                           <span class="idlParam">optional <span class="idlParamType"><a data-link-type="dfn" href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dom-jsonldoptions"><code>JsonLdOptions</code></a>?</span> <span class="idlParamName">options</span></span>);</span>
};</span></pre></div>
    <p>The <dfn data-dfn-type="dfn" id="dom-jsonldprocessor" data-idl="" data-title="JsonLdProcessor" data-dfn-for=""><code>JsonLdProcessor</code></dfn> interface
      <dfn data-dfn-for="jsonldprocessor" data-dfn-type="dfn" id="dom-jsonldprocessor-frame" data-idl="" data-title="frame" data-lt="frame|frame()"><code>frame</code></dfn> method
      <a href="#framing">Frames</a>
      the given <code>input</code> using <a data-lt="JsonLdProcessor-frame-frame" href="#dfn-jsonldprocessor-frame-frame" class="internalDFN" data-link-type="dfn">frame</a>
      according to the steps in the <a href="#framing-algorithm">Framing
      Algorithm</a>:</p>
    <ol>
      <li>Create a new <a href="#dfn-promises" class="internalDFN" data-link-type="dfn">Promise</a> <var>promise</var> and return it. The
        following steps are then executed asynchronously.</li>
      <li>Set <var>expanded input</var> to the result of using the
        <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dom-jsonldprocessor-expand">expand</a>
        method using <a data-lt="JsonLdProcessor-frame-input" href="#dfn-jsonldprocessor-frame-input" class="internalDFN" data-link-type="dfn">input</a> and <a data-lt="JsonLdProcessor-frame-options" href="#dfn-jsonldprocessor-frame-options" class="internalDFN" data-link-type="dfn">options</a>.
      </li><li>Set <var>expanded frame</var> to the result of using the
        <code class="idlMemberName"><a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dom-jsonldprocessor-expand">expand</a></code>
        method using
        <a data-lt="JsonLdProcessor-frame-frame" href="#dfn-jsonldprocessor-frame-frame" class="internalDFN" data-link-type="dfn">frame</a> and
        <a data-lt="JsonLdProcessor-frame-options" href="#dfn-jsonldprocessor-frame-options" class="internalDFN" data-link-type="dfn">options</a> with
        <code class="idlMemberName"><a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dom-jsonldoptions-expandcontext">expandContext</a></code> set to <code>null</code>
        and the <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dom-jsonldoptions-frameexpansion">frameExpansion</a> option set to <code>true</code>.
      </li><li>Set <var>context</var> to the value of <code>@context</code>
        from <a data-lt="JsonLdProcessor-frame-frame" href="#dfn-jsonldprocessor-frame-frame" class="internalDFN" data-link-type="dfn">frame</a>, if it exists, or to
        a new empty <a href="#dfn-contexts" class="internalDFN" data-link-type="dfn">context</a>, otherwise.</li>
      <li class="changed">Initialize an <a href="#dfn-active-context" class="internalDFN" data-link-type="dfn">active context</a> using <var>context</var>;
        the <a href="#dfn-base-iris" class="internalDFN" data-link-type="dfn">base <abbr title="Internationalized Resource Identifier">IRI</abbr></a> is set to
        the <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dom-jsonldoptions-base">base</a> option from
        <a data-lt="jsonldprocessor-frame-options" href="#dfn-jsonldprocessor-frame-options" class="internalDFN" data-link-type="dfn">options</a>, if set;
        otherwise, if the
        <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dom-jsonldoptions-compacttorelative">compactToRelative</a> option is
        <strong>true</strong>, to the <abbr title="Internationalized Resource Identifier">IRI</abbr> of the currently being processed
        document, if available; otherwise to <code>null</code>.</li>
      <li>If <a data-lt="JsonLdProcessor-frame-frame" href="#dfn-jsonldprocessor-frame-frame" class="internalDFN" data-link-type="dfn">frame</a> has a top-level
        property which expands to <code>@graph</code> set the <a data-link-for="JsonLdOptions" href="#dom-jsonldoptions-framedefault" class="internalDFN" data-link-type="dfn"><code>frameDefault</code></a>
        option to <a data-lt="JsonLdProcessor-frame-options" href="#dfn-jsonldprocessor-frame-options" class="internalDFN" data-link-type="dfn">options</a> with the
        value <code>true</code>.</li>
      <li>Set <var>framed</var> to the result of using the
        <a href="#framing-algorithm">Framing algorithm</a>, passing
        <var>expanded input</var>, <var>expanded frame</var>, <a href="#dfn-active-context" class="internalDFN" data-link-type="dfn">active context</a>, and <var>options</var>.</li>
      <li>Fulfill the <var>promise</var> passing <var>framed</var>.</li>
    </ol>

    <dl class="parameters">
      <dt><dfn data-lt="jsonldprocessor-frame-input" data-lt-nodefault="" data-dfn-type="dfn" id="dfn-jsonldprocessor-frame-input">input</dfn></dt>
       <dd>The JSON-LD object or array of JSON-LD objects to perform the framing upon or an
        <a href="#dfn-iris" class="internalDFN" data-link-type="dfn"><abbr title="Internationalized Resource Identifier">IRI</abbr></a> referencing the JSON-LD document to frame.</dd>
      <dt><dfn data-lt="jsonldprocessor-frame-frame" data-lt-nodefault="" data-dfn-type="dfn" id="dfn-jsonldprocessor-frame-frame">frame</dfn></dt>
      <dd>The frame to use when re-arranging the data of <code>input</code>; either
        in the form of an <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a> or as <a href="#dfn-iris" class="internalDFN" data-link-type="dfn"><abbr title="Internationalized Resource Identifier">IRI</abbr></a>.</dd>
      <dt><dfn data-lt="jsonldprocessor-frame-options" data-lt-nodefault="" data-dfn-type="dfn" id="dfn-jsonldprocessor-frame-options">options</dfn></dt>
      <dd>A set of options that <em class="rfc2119" title="MAY">MAY</em> affect the framing algorithm such as, e.g., the
        input document's base <a href="#dfn-iris" class="internalDFN" data-link-type="dfn"><abbr title="Internationalized Resource Identifier">IRI</abbr></a>.</dd>
    </dl>

  </section>

  <section id="error-handling">
    <h3 id="x5-2-error-handling"><span class="secno">5.2 </span>Error Handling&nbsp;<span class="permalink"><a href="#error-handling" aria-label="Permalink for 5.2 Error Handling" title="Permalink for 5.2 Error Handling"><span>§</span></a></span></h3>
    <p>The <dfn data-dfn-type="dfn" id="dom-jsonldframingerror" data-idl="" data-title="JsonLdFramingError" data-dfn-for=""><code>JsonLdFramingError</code></dfn> type is used to report processing errors.</p>

    <div><pre class="def idl"><span class="idlDictionary" id="idl-def-jsonldframingerror" data-idl="" data-title="JsonLdFramingError">dictionary <span class="idlDictionaryID"><a data-no-default="" data-link-for="" data-lt="" href="#dom-jsonldframingerror" class="internalDFN" data-link-type="dfn"><code>JsonLdFramingError</code></a></span> {
<span class="idlMember" id="idl-def-jsonldframingerror-code" data-idl="" data-title="code" data-dfn-for="jsonldframingerror">    <span class="idlMemberType"><a href="#dom-jsonldframingerrorcode" class="internalDFN" data-link-type="dfn"><code>JsonLdFramingErrorCode</code></a></span> <span class="idlMemberName"><a data-no-default="" data-link-for="jsonldframingerror" data-lt="" href="#dom-jsonldframingerror-code" class="internalDFN" data-link-type="dfn"><code>code</code></a></span>;</span>
<span class="idlMember" id="idl-def-jsonldframingerror-message" data-idl="" data-title="message" data-dfn-for="jsonldframingerror">    <span class="idlMemberType"><a href="https://heycam.github.io/webidl/#idl-USVString">USVString</a>?</span>             <span class="idlMemberName"><a data-no-default="" data-link-for="jsonldframingerror" data-lt="" href="#dom-jsonldframingerror-message" class="internalDFN" data-link-type="dfn"><code>message</code></a></span> = <span class="idlMemberValue">null</span>;</span>
};</span>

<span class="idlEnum" id="idl-def-jsonldframingerrorcode" data-idl="" data-title="JsonLdFramingErrorCode">enum <span class="idlEnumID"><a data-no-default="" data-link-for="" data-lt="" href="#dom-jsonldframingerrorcode" class="internalDFN" data-link-type="dfn"><code>JsonLdFramingErrorCode</code></a></span> {
    <a href="#dom-jsonldframingerrorcode-invalid-frame" class="idlEnumItem">"invalid frame"</a>,
    <a href="#dom-jsonldframingerrorcode-invalid--embed-value" class="idlEnumItem">"invalid @embed value"</a>
};</span></pre></div>
    <p>JSON-LD Framing extends the error interface and codes defined in
      <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#error-handling"></a> the JSON-LD 1.1 API [<cite><a class="bibref" href="#bib-JSON-LD11CG-API">JSON-LD11CG-API</a></cite>].

    </p><dl>
      <dt><dfn data-dfn-for="jsonldframingerror" data-dfn-type="dfn" id="dom-jsonldframingerror-code" data-idl="" data-title="code"><code>code</code></dfn></dt>
      <dd>a string representing the particular error type, as described in
        the various algorithms in this document.</dd>
      <dt><dfn data-dfn-for="jsonldframingerror" data-dfn-type="dfn" id="dom-jsonldframingerror-message" data-idl="" data-title="message"><code>message</code></dfn></dt>
      <dd>an optional error message containing additional debugging information.
        The specific contents of error messages are outside the scope of this
        specification.</dd>
    </dl>

    <p>The <dfn data-dfn-type="dfn" id="dom-jsonldframingerrorcode" data-idl="" data-title="JsonLdFramingErrorCode" data-dfn-for=""><code>JsonLdFramingErrorCode</code></dfn> represents the collection of valid JSON-LD Framing error
      codes.</p>
    <dl data-dfn-for="JsonLdFramingErrorCode" data-sort=""><dt><dfn data-dfn-for="jsonldframingerrorcode" data-dfn-type="dfn" id="dom-jsonldframingerrorcode-invalid--embed-value" data-idl="" data-title="invalid @embed value"><code>invalid @embed value</code></dfn></dt><dd>
        The value for <code>@embed</code> is not one recognized for the <a href="#dfn-object-embed-flag" class="internalDFN" data-link-type="dfn">object embed flag</a>.
      </dd><dt><dfn data-dfn-for="jsonldframingerrorcode" data-dfn-type="dfn" id="dom-jsonldframingerrorcode-invalid-frame" data-idl="" data-title="invalid frame"><code>invalid frame</code></dfn></dt><dd>
        The frame is invalid.
      </dd>
      </dl>
  </section>

  <section id="data-structures">
    <h3 id="x5-3-data-structures"><span class="secno">5.3 </span>Data Structures&nbsp;<span class="permalink"><a href="#data-structures" aria-label="Permalink for 5.3 Data Structures" title="Permalink for 5.3 Data Structures"><span>§</span></a></span></h3>
    <p>This section describes datatype definitions used within the JSON-LD API.</p>

    <section id="jsonldcontext">
    <h4 id="x5-3-1-jsonldcontext"><span class="secno">5.3.1 </span>JsonLdContext&nbsp;<span class="permalink"><a href="#jsonldcontext" aria-label="Permalink for 5.3.1 JsonLdContext" title="Permalink for 5.3.1 JsonLdContext"><span>§</span></a></span></h4>
    <p>The <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dom-jsonldcontext">JsonLdContext</a> type is used to refer to a value that
        that may be a <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionary</a>, a <a href="#dfn-strings" class="internalDFN" data-link-type="dfn">string</a> representing an
        <a href="#dfn-iris" class="internalDFN" data-link-type="dfn"><abbr title="Internationalized Resource Identifier">IRI</abbr></a>, or an array of <a class="changed" data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary">dictionaries</a>
        and <a href="#dfn-strings" class="internalDFN" data-link-type="dfn">strings</a>.</p>

    <p>See <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dom-jsonldcontext">JsonLdContext</a> definition in the JSON-LD 1.1 API [<cite><a class="bibref" href="#bib-JSON-LD11CG-API">JSON-LD11CG-API</a></cite>].</p>
    </section>

    <section id="jsonldoptions">
    <h4 id="x5-3-2-jsonldoptions"><span class="secno">5.3.2 </span>JsonLdOptions&nbsp;<span class="permalink"><a href="#jsonldoptions" aria-label="Permalink for 5.3.2 JsonLdOptions" title="Permalink for 5.3.2 JsonLdOptions"><span>§</span></a></span></h4>
    <p>The <dfn data-dfn-type="dfn" id="dom-jsonldoptions" data-idl="" data-title="JsonLdOptions" data-dfn-for=""><a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dom-jsonldoptions"><code>JsonLdOptions</code></a></dfn> type is used to pass various options to the
      <a href="#dom-jsonldprocessor" class="internalDFN" data-link-type="dfn"><code>JsonLdProcessor</code></a> methods.</p>

    <div><pre class="def idl"><span class="idlDictionary" id="idl-def-jsonldoptions" data-idl="" data-title="JsonLdOptions">dictionary <span class="idlDictionaryID"><a data-no-default="" data-link-for="" data-lt="" data-link-type="dfn" href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dom-jsonldoptions"><code>JsonLdOptions</code></a></span> {
<span class="idlMember" id="idl-def-jsonldoptions-embed" data-idl="" data-title="embed" data-dfn-for="jsonldoptions">    <span class="idlMemberType">(<a href="#dom-jsonldembed" class="internalDFN" data-link-type="dfn"><code>JsonLdEmbed</code></a> or <a href="https://heycam.github.io/webidl/#idl-boolean">boolean</a>)</span> <span class="idlMemberName"><a data-no-default="" data-link-for="jsonldoptions" data-lt="" href="#dom-jsonldoptions-embed" class="internalDFN" data-link-type="dfn"><code>embed</code></a></span> = <span class="idlMemberValue">"@last"</span>;</span>
<span class="idlMember" id="idl-def-jsonldoptions-explicit" data-idl="" data-title="explicit" data-dfn-for="jsonldoptions">    <span class="idlMemberType"><a href="https://heycam.github.io/webidl/#idl-boolean">boolean</a></span>                  <span class="idlMemberName"><a data-no-default="" data-link-for="jsonldoptions" data-lt="" href="#dom-jsonldoptions-explicit" class="internalDFN" data-link-type="dfn"><code>explicit</code></a></span> = <span class="idlMemberValue">false</span>;</span>
<span class="idlMember" id="idl-def-jsonldoptions-omitdefault" data-idl="" data-title="omitDefault" data-dfn-for="jsonldoptions">    <span class="idlMemberType"><a href="https://heycam.github.io/webidl/#idl-boolean">boolean</a></span>                  <span class="idlMemberName"><a data-no-default="" data-link-for="jsonldoptions" data-lt="" href="#dom-jsonldoptions-omitdefault" class="internalDFN" data-link-type="dfn"><code>omitDefault</code></a></span> = <span class="idlMemberValue">false</span>;</span>
<span class="idlMember" id="idl-def-jsonldoptions-omitgraph" data-idl="" data-title="omitGraph" data-dfn-for="jsonldoptions">    <span class="idlMemberType"><a href="https://heycam.github.io/webidl/#idl-boolean">boolean</a></span>                  <span class="idlMemberName"><a data-no-default="" data-link-for="jsonldoptions" data-lt="" href="#dom-jsonldoptions-omitgraph" class="internalDFN" data-link-type="dfn"><code>omitGraph</code></a></span>;</span>
<span class="idlMember" id="idl-def-jsonldoptions-requireall" data-idl="" data-title="requireAll" data-dfn-for="jsonldoptions">    <span class="idlMemberType"><a href="https://heycam.github.io/webidl/#idl-boolean">boolean</a></span>                  <span class="idlMemberName"><a data-no-default="" data-link-for="jsonldoptions" data-lt="" href="#dom-jsonldoptions-requireall" class="internalDFN" data-link-type="dfn"><code>requireAll</code></a></span> = <span class="idlMemberValue">false</span>;</span>
<span class="idlMember" id="idl-def-jsonldoptions-framedefault" data-idl="" data-title="frameDefault" data-dfn-for="jsonldoptions">    <span class="idlMemberType"><a href="https://heycam.github.io/webidl/#idl-boolean">boolean</a></span>                  <span class="idlMemberName"><a data-no-default="" data-link-for="jsonldoptions" data-lt="" href="#dom-jsonldoptions-framedefault" class="internalDFN" data-link-type="dfn"><code>frameDefault</code></a></span> = <span class="idlMemberValue">false</span>;</span>
};</span>

<span class="idlEnum" id="idl-def-jsonldembed" data-idl="" data-title="JsonLdEmbed">enum <span class="idlEnumID"><a data-no-default="" data-link-for="" data-lt="" href="#dom-jsonldembed" class="internalDFN" data-link-type="dfn"><code>JsonLdEmbed</code></a></span> {
    <a href="#dom-jsonldembed-@always" class="idlEnumItem">"@always"</a>,
    <a href="#dom-jsonldembed-@last" class="idlEnumItem">"@last"</a>,
    <a href="#dom-jsonldembed-@never" class="idlEnumItem">"@never"</a>
};</span></pre></div>

    <p>In addition to those options defined in the JSON-LD 1.1 API [<cite><a class="bibref" href="#bib-JSON-LD11CG-API">JSON-LD11CG-API</a></cite>], framing defines these
      additional options:</p>

    <dl data-sort=""><dt><dfn data-dfn-for="jsonldoptions" data-dfn-type="dfn" id="dom-jsonldoptions-embed" data-idl="" data-title="embed"><code>embed</code></dfn></dt>
      <dd>Sets the value <a href="#dfn-object-embed-flag" class="internalDFN" data-link-type="dfn">object embed flag</a> used in the
        <a href="#framing-algorithm">Framing Algorithm</a>.
        A boolean value of <code>true</code> sets the flag to
        <code>@last</code>, while an value of <code>false</code> sets the flag
        to <code>@never</code>.</dd>
      <dt><dfn data-dfn-for="jsonldoptions" data-dfn-type="dfn" id="dom-jsonldoptions-explicit" data-idl="" data-title="explicit"><code>explicit</code></dfn></dt>
      <dd>Sets the value <a href="#dfn-explicit-inclusion-flag" class="internalDFN" data-link-type="dfn">explicit inclusion flag</a> used in the
        <a href="#framing-algorithm">Framing Algorithm</a>.
      </dd>
      <dt><dfn data-dfn-for="jsonldoptions" data-dfn-type="dfn" id="dom-jsonldoptions-framedefault" data-idl="" data-title="frameDefault"><code>frameDefault</code></dfn></dt>
      <dd>Instead of framing a <var>merged graph</var>, frame only the <a href="#dfn-default-graph" class="internalDFN" data-link-type="dfn">default graph</a>.</dd><dt><dfn data-dfn-for="jsonldoptions" data-dfn-type="dfn" id="dom-jsonldoptions-omitdefault" data-idl="" data-title="omitDefault"><code>omitDefault</code></dfn></dt>
      <dd>Sets the value <a href="#dfn-omit-default-flag" class="internalDFN" data-link-type="dfn">omit default flag</a> used in the
        <a href="#framing-algorithm">Framing Algorithm</a></dd>
      <dt class="changed"><dfn data-dfn-for="jsonldoptions" data-dfn-type="dfn" id="dom-jsonldoptions-omitgraph" data-idl="" data-title="omitGraph"><code>omitGraph</code></dfn></dt>
      <dd class="changed">Sets the value <a href="#dfn-omit-graph-flag" class="internalDFN" data-link-type="dfn">omit graph flag</a> used in the
        <a href="#framing-algorithm">Framing Algorithm</a>. If not set explicitly,
        it is set to <code>false</code> if <a href="#dfn-processing-mode" class="internalDFN" data-link-type="dfn">processing mode</a> if <code>json-ld-1.0</code>, <code>true</code> otherwise.</dd>
      <dt><dfn data-dfn-for="jsonldoptions" data-dfn-type="dfn" id="dom-jsonldoptions-requireall" data-idl="" data-title="requireAll"><code>requireAll</code></dfn></dt>
      <dd>Sets the value <a href="#dfn-require-all-flag" class="internalDFN" data-link-type="dfn">require all flag</a> used in the
        <a href="#framing-algorithm">Framing Algorithm</a>.</dd>
      </dl>

    <p><dfn data-dfn-type="dfn" id="dom-jsonldembed" data-idl="" data-title="JsonLdEmbed" data-dfn-for=""><code>JsonLdEmbed</code></dfn> enumerates the values of the <a data-link-for="JsonLdOptions" href="#dom-jsonldoptions-embed" class="internalDFN" data-link-type="dfn"><code>embed</code></a> option:</p>
    <dl data-sort=""><dt><dfn data-dfn-for="jsonldembed" data-dfn-type="dfn" id="dom-jsonldembed-@always" data-idl="" data-title="@always"><code>@always</code></dfn></dt><dd>
        Always embed <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node objects</a> as property values, unless this would
        cause a circular reference.</dd>
      <dt><dfn data-dfn-for="jsonldembed" data-dfn-type="dfn" id="dom-jsonldembed-@last" data-idl="" data-title="@last"><code>@last</code></dfn></dt><dd>
        Only the last value within a given <a href="#dfn-node-objects" class="internalDFN" data-link-type="dfn">node object</a> should be embedded,
        previous values of other properties use a <a href="#dfn-node-references" class="internalDFN" data-link-type="dfn">node reference</a>. This is the
        default value if neither <code>@embed</code> nor <a href="#dfn-object-embed-flag" class="internalDFN" data-link-type="dfn">object embed flag</a>
        is not specified.</dd>
      <dt class="changed"><dfn data-dfn-for="jsonldembed" data-dfn-type="dfn" id="dom-jsonldembed-@never" data-idl="" data-title="@never"><code>@never</code></dfn></dt><dd class="changed">
        Always use a <a href="#dfn-node-references" class="internalDFN" data-link-type="dfn">node reference</a> when serializing matching values.</dd></dl>

    <p>See <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dom-jsonldoptions">JsonLdOptions</a> definition in the JSON-LD 1.1 API [<cite><a class="bibref" href="#bib-JSON-LD11CG-API">JSON-LD11CG-API</a></cite>].</p>
  </section>
  </section>

</section>

<section class="appendix informative" id="iana-considerations">
<!--OddPage--><h2 id="a-iana-considerations"><span class="secno">A. </span>IANA Considerations&nbsp;<span class="permalink"><a href="#iana-considerations" aria-label="Permalink for A. IANA Considerations" title="Permalink for A. IANA Considerations"><span>§</span></a></span></h2><p><em>This section is non-normative.</em></p>

<p>This section is included merely for standards community review and will be
submitted to the Internet Engineering Steering Group if this specification
becomes a W3C Recommendation.</p>

<h2 id="application-ld-frame-json">application/ld-frame+json&nbsp;<span class="permalink"><a href="#iana-considerations" aria-label="Permalink for application/ld-frame+json" title="Permalink for application/ld-frame+json"><span>§</span></a></span></h2>
<dl>
  <dt>Type name:</dt>
  <dd>application</dd>
  <dt>Subtype name:</dt>
  <dd>ld-frame+json</dd>
  <dt>Required parameters:</dt>
  <dd>None</dd>
  <dt>Optional parameters:</dt>
  <dd>None</dd>
  <dt>Encoding considerations:</dt>
  <dd>The same as the <code>application/json</code> MIME media type.</dd>
  <dt>Security considerations:</dt>
  <dd>Since a JSON-LD frame is intended to specify a deterministic layout
    for a JSON-LD graph, the serialization <em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em> be passed through a
    code execution mechanism such as JavaScript's <code>eval()</code>
    function. It is <em class="rfc2119" title="RECOMMENDED">RECOMMENDED</em> that a conforming parser does not attempt to
    directly evaluate the JSON-LD frame and instead purely parse the
    input into a language-native data structure.</dd>
  <dt>Interoperability considerations:</dt>
  <dd>Not Applicable</dd>
  <dt>Published specification:</dt>
  <dd>The <a href="https://json-ld.org/spec/latest/">JSON-LD</a> specification.</dd>
  <dt>Applications that use this media type:</dt>
  <dd>Any programming environment that requires the exchange of
    directed graphs. Implementations of JSON-LD have been created for
    JavaScript, Python, Ruby, PHP and C++.
  </dd>
  <dt>Additional information:</dt>
  <dd>
    <dl>
      <dt>Magic number(s):</dt>
      <dd>Not Applicable</dd>
      <dt>File extension(s):</dt>
      <dd>.jsonldf</dd>
      <dt>Macintosh file type code(s):</dt>
      <dd>TEXT</dd>
    </dl>
  </dd>
  <dt>Person &amp; email address to contact for further information:</dt>
  <dd>Manu Sporny &lt;msporny@digitalbazaar.com&gt;</dd>
  <dt>Intended usage:</dt>
  <dd>Common</dd>
  <dt>Restrictions on usage:</dt>
  <dd>None</dd>
  <dt>Author(s):</dt>
  <dd>Manu Sporny, Gregg Kellogg, Markus Lanthaler, Dave Longley</dd>
  <dt>Change controller:</dt>
  <dd>W3C</dd>
</dl>

<p>Fragment identifiers have no meaning with
  <a href="#application-ld-frame-json">application/frame-ld+json</a> resources.</p>

</section>

<section id="security" class="appendix">
  <!--OddPage--><h2 id="b-security-considerations"><span class="secno">B. </span>Security Considerations&nbsp;<span class="permalink"><a href="#security" aria-label="Permalink for B. Security Considerations" title="Permalink for B. Security Considerations"><span>§</span></a></span></h2>
  <div class="ednote" id="issue-container-generatedID-8"><div role="heading" class="ednote-title marker" id="h-ednote-0" aria-level="3"><span>Editor's note</span></div><p class="">Consider requirements from <a href="https://w3ctag.github.io/security-questionnaire/">Self-Review Questionnaire: Security and Privacy</a>.</p></div>
  <p>See, <a href="#iana-considerations" class="sectionRef sec-ref">section <span class="secno">A.</span> <span class="sec-title">IANA Considerations</span></a></p>
</section>

<section id="idl-index" class="appendix informative"><!--OddPage--><h2 id="c-idl-index"><span class="secno">C. </span>IDL Index&nbsp;<span class="permalink"><a href="#idl-index" aria-label="Permalink for C. IDL Index" title="Permalink for C. IDL Index"><span>§</span></a></span></h2><p><em>This section is non-normative.</em></p>
<div><pre class="idl def" id="actual-idl-index"><span class="respec-idl-separator"><span class="idlInterface" data-idl="" data-title="JsonLdProcessor">[<span class="idlCtor"><span class="extAttrName"><a href="https://heycam.github.io/webidl/#Constructor">Constructor</a></span></span>]
interface <span class="idlInterfaceID"><a data-no-default="" data-link-for="" data-lt="" href="#dom-jsonldprocessor" class="internalDFN" data-link-type="dfn"><code>JsonLdProcessor</code></a></span> {
<span class="idlMethod" data-idl="" data-title="frame" data-dfn-for="jsonldprocessor">    static <span class="idlMethType"><a href="https://heycam.github.io/webidl/#idl-promise">Promise</a>&lt;JsonLdDictionary&gt;</span> <span class="idlMethName"><a data-no-default="" data-link-for="jsonldprocessor" data-lt="frame|frame()" href="#dom-jsonldprocessor-frame" class="internalDFN" data-link-type="dfn"><code>frame</code></a></span>(<span class="idlParam"><span class="idlParamType">JsonLdInput</span> <span class="idlParamName">input</span></span>,
                                           <span class="idlParam"><span class="idlParamType">(JsonLdDictionary or <a href="https://heycam.github.io/webidl/#idl-USVString">USVString</a>)</span> <span class="idlParamName">frame</span></span>,
                                           <span class="idlParam">optional <span class="idlParamType"><a data-link-type="dfn" href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dom-jsonldoptions"><code>JsonLdOptions</code></a>?</span> <span class="idlParamName">options</span></span>);</span>
};</span>
</span><span class="respec-idl-separator"><span class="idlDictionary" data-idl="" data-title="JsonLdFramingError">dictionary <span class="idlDictionaryID"><a data-no-default="" data-link-for="" data-lt="" href="#dom-jsonldframingerror" class="internalDFN" data-link-type="dfn"><code>JsonLdFramingError</code></a></span> {
<span class="idlMember" data-idl="" data-title="code" data-dfn-for="jsonldframingerror">    <span class="idlMemberType"><a href="#dom-jsonldframingerrorcode" class="internalDFN" data-link-type="dfn"><code>JsonLdFramingErrorCode</code></a></span> <span class="idlMemberName"><a data-no-default="" data-link-for="jsonldframingerror" data-lt="" href="#dom-jsonldframingerror-code" class="internalDFN" data-link-type="dfn"><code>code</code></a></span>;</span>
<span class="idlMember" data-idl="" data-title="message" data-dfn-for="jsonldframingerror">    <span class="idlMemberType"><a href="https://heycam.github.io/webidl/#idl-USVString">USVString</a>?</span>             <span class="idlMemberName"><a data-no-default="" data-link-for="jsonldframingerror" data-lt="" href="#dom-jsonldframingerror-message" class="internalDFN" data-link-type="dfn"><code>message</code></a></span> = <span class="idlMemberValue">null</span>;</span>
};</span>
<span class="idlEnum" data-idl="" data-title="JsonLdFramingErrorCode">enum <span class="idlEnumID"><a data-no-default="" data-link-for="" data-lt="" href="#dom-jsonldframingerrorcode" class="internalDFN" data-link-type="dfn"><code>JsonLdFramingErrorCode</code></a></span> {
    <a href="#dom-jsonldframingerrorcode-invalid-frame" class="idlEnumItem">"invalid frame"</a>,
    <a href="#dom-jsonldframingerrorcode-invalid--embed-value" class="idlEnumItem">"invalid @embed value"</a>
};</span>
</span><span class="respec-idl-separator"><span class="idlDictionary" data-idl="" data-title="JsonLdOptions">dictionary <span class="idlDictionaryID"><a data-no-default="" data-link-for="" data-lt="" data-link-type="dfn" href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/#dom-jsonldoptions"><code>JsonLdOptions</code></a></span> {
<span class="idlMember" data-idl="" data-title="embed" data-dfn-for="jsonldoptions">    <span class="idlMemberType">(<a href="#dom-jsonldembed" class="internalDFN" data-link-type="dfn"><code>JsonLdEmbed</code></a> or <a href="https://heycam.github.io/webidl/#idl-boolean">boolean</a>)</span> <span class="idlMemberName"><a data-no-default="" data-link-for="jsonldoptions" data-lt="" href="#dom-jsonldoptions-embed" class="internalDFN" data-link-type="dfn"><code>embed</code></a></span> = <span class="idlMemberValue">"@last"</span>;</span>
<span class="idlMember" data-idl="" data-title="explicit" data-dfn-for="jsonldoptions">    <span class="idlMemberType"><a href="https://heycam.github.io/webidl/#idl-boolean">boolean</a></span>                  <span class="idlMemberName"><a data-no-default="" data-link-for="jsonldoptions" data-lt="" href="#dom-jsonldoptions-explicit" class="internalDFN" data-link-type="dfn"><code>explicit</code></a></span> = <span class="idlMemberValue">false</span>;</span>
<span class="idlMember" data-idl="" data-title="omitDefault" data-dfn-for="jsonldoptions">    <span class="idlMemberType"><a href="https://heycam.github.io/webidl/#idl-boolean">boolean</a></span>                  <span class="idlMemberName"><a data-no-default="" data-link-for="jsonldoptions" data-lt="" href="#dom-jsonldoptions-omitdefault" class="internalDFN" data-link-type="dfn"><code>omitDefault</code></a></span> = <span class="idlMemberValue">false</span>;</span>
<span class="idlMember" data-idl="" data-title="omitGraph" data-dfn-for="jsonldoptions">    <span class="idlMemberType"><a href="https://heycam.github.io/webidl/#idl-boolean">boolean</a></span>                  <span class="idlMemberName"><a data-no-default="" data-link-for="jsonldoptions" data-lt="" href="#dom-jsonldoptions-omitgraph" class="internalDFN" data-link-type="dfn"><code>omitGraph</code></a></span>;</span>
<span class="idlMember" data-idl="" data-title="requireAll" data-dfn-for="jsonldoptions">    <span class="idlMemberType"><a href="https://heycam.github.io/webidl/#idl-boolean">boolean</a></span>                  <span class="idlMemberName"><a data-no-default="" data-link-for="jsonldoptions" data-lt="" href="#dom-jsonldoptions-requireall" class="internalDFN" data-link-type="dfn"><code>requireAll</code></a></span> = <span class="idlMemberValue">false</span>;</span>
<span class="idlMember" data-idl="" data-title="frameDefault" data-dfn-for="jsonldoptions">    <span class="idlMemberType"><a href="https://heycam.github.io/webidl/#idl-boolean">boolean</a></span>                  <span class="idlMemberName"><a data-no-default="" data-link-for="jsonldoptions" data-lt="" href="#dom-jsonldoptions-framedefault" class="internalDFN" data-link-type="dfn"><code>frameDefault</code></a></span> = <span class="idlMemberValue">false</span>;</span>
};</span>
<span class="idlEnum" data-idl="" data-title="JsonLdEmbed">enum <span class="idlEnumID"><a data-no-default="" data-link-for="" data-lt="" href="#dom-jsonldembed" class="internalDFN" data-link-type="dfn"><code>JsonLdEmbed</code></a></span> {
    <a href="#dom-jsonldembed-@always" class="idlEnumItem">"@always"</a>,
    <a href="#dom-jsonldembed-@last" class="idlEnumItem">"@last"</a>,
    <a href="#dom-jsonldembed-@never" class="idlEnumItem">"@never"</a>
};</span>
</span></pre></div></section>

<section class="appendix informative" id="changes-since-1-0-draft-of-30-august-2012">
  <!--OddPage--><h2 id="d-changes-since-1-0-draft-of-30-august-2012"><span class="secno">D. </span>Changes since 1.0 Draft of 30 August 2012&nbsp;<span class="permalink"><a href="#changes-since-1-0-draft-of-30-august-2012" aria-label="Permalink for D. Changes since 1.0 Draft of 30 August 2012" title="Permalink for D. Changes since 1.0 Draft of 30 August 2012"><span>§</span></a></span></h2><p><em>This section is non-normative.</em></p>
  <ul>
    <li>There are numerous formatting and terminology changes intended to align with
      the 1.0 Recommendations of JSON-LD and JSON-LD-API in addition to the use
      of common term definition sections.</li>
    <li>The <a href="#dfn-object-embed-flag" class="internalDFN" data-link-type="dfn">object embed flag</a> (<code>@embed</code>) can take on different
      values to better control object embedding.</li>
    <li>Framing supports <em>More specific frame matching</em>, where
      general <code><a href="#dfn-wildcard" class="internalDFN" data-link-type="dfn"><code>wildcard</code></a></code> and <code><a href="#dfn-match-none" class="internalDFN" data-link-type="dfn"><code>match none</code></a></code>
      can be used for type and property values.</li>
    <li>Frame matching also supports value object matching, where
      values for <code>@value</code>, <code>@type</code>, and <code>@language</code>
      can use <code><a href="#dfn-wildcard" class="internalDFN" data-link-type="dfn"><code>wildcard</code></a></code> and <code><a href="#dfn-match-none" class="internalDFN" data-link-type="dfn"><code>match none</code></a></code>
      and may also use a set of specific strings to match (e.g., a set of specific
      languages).</li>
    <li>Framing allows specific graphs to be matched, and the outer-most frame
      can either come from the merged graph or the <a href="#dfn-default-graph" class="internalDFN" data-link-type="dfn">default graph</a>.</li>
    <li>Framing supports <code>@reverse</code>.</li>
    <li>Through the use of <em>scoped contexts</em>, parts of a frame can be
      compacted using a different context than is used for the outer-most
      object.</li>
    <li>Frames can use one or more values for <code>@id</code> to allow for matching
      specific objects in a frame.</li>
    <li>If <a href="#dfn-processing-mode" class="internalDFN" data-link-type="dfn">processing mode</a> is <code>json-ld-1.1</code>,
      <code>@id</code> members who's value is a <a href="#dfn-blank-node-identifiers" class="internalDFN" data-link-type="dfn">blank node identifier</a>
      used only for that <code>@id</code> are removed.</li>
    <li>The JSON syntax has been abstracted into an <a href="#dfn-internal-representation" class="internalDFN" data-link-type="dfn">internal representation</a>
      to allow for other serialization formats that are functionally equivalent
      to JSON.</li>
    <li>Preserved values are compacted using the properties of the referencing term.</li>
    <li>Removed support for <code>@link</code> and in-memory object linking.</li>
    <li>Added the <a href="#dfn-omit-default-flag" class="internalDFN" data-link-type="dfn">omit default flag</a>, controled via the
      <a data-link-for="JsonLdOptions" href="#dom-jsonldoptions-omitdefault" class="internalDFN" data-link-type="dfn"><code>omitDefault</code></a> API option and/or
      the current <a href="#dfn-processing-mode" class="internalDFN" data-link-type="dfn">processing mode</a>.</li>
  </ul>
</section>

<section class="appendix informative" id="open-issues">
  <!--OddPage--><h2 id="e-open-issues"><span class="secno">E. </span>Open Issues&nbsp;<span class="permalink"><a href="#open-issues" aria-label="Permalink for E. Open Issues" title="Permalink for E. Open Issues"><span>§</span></a></span></h2><p><em>This section is non-normative.</em></p>
  <p>The following is a list of issues open at the time of publication.</p>
  <div class="issue" id="issue-container-number-542"><div role="heading" class="issue-title marker" id="h-issue-0" aria-level="3"><a href="https://github.com/json-ld/json-ld.org/issues/542"><span>Issue 542</span></a><span style="text-transform: none">: Feature request: Could framing return properties in the order listed by the frame? <a class="respec-gh-label respec-label-light" href="https://github.com/json-ld/json-ld.org//issues/?q=is%3Aissue+is%3Aopen+label%3A%22api%22" style="background-color: rgb(245, 169, 242);">api</a><a class="respec-gh-label respec-label-dark" href="https://github.com/json-ld/json-ld.org//issues/?q=is%3Aissue+is%3Aopen+label%3A%22defer%22" style="background-color: rgb(0, 82, 204);">defer</a><a class="respec-gh-label respec-label-dark" href="https://github.com/json-ld/json-ld.org//issues/?q=is%3Aissue+is%3Aopen+label%3A%22framing%22" style="background-color: rgb(68, 68, 68);">framing</a></span></div><p>Currently it appears that properties are sorted into alphabetical order after any JSON-LD operation (compaction, framing).</p>
<p>In the context of framing, this is sometimes a nice feature, since it means that after framing multiple input JSON files, the JSON data is at least in a consistent order.</p>
<p>I understand that ordering is semantically meaningless, but as framing exists to turn the graph (which could correspond to multiple different trees) into a predictable JSON tree as a convenience for developers, it seems natural to me that if an explicit ordering is given in the frame, that the algorithm would respect that order rather than alphabetize.  For example, if my data is:</p>
<pre aria-busy="false" class="hljs json">{
  <span class="hljs-attr">"@context"</span>: <span class="hljs-string">"http://schema.org/"</span>,
  <span class="hljs-attr">"@id"</span>: <span class="hljs-string">"document"</span>,
  <span class="hljs-attr">"b"</span>: <span class="hljs-string">"text"</span>,
  <span class="hljs-attr">"a"</span>: <span class="hljs-string">"more text"</span>

}
</pre>
<p>Under the frame:</p>
<pre aria-busy="false" class="hljs json">{
  <span class="hljs-attr">"@context"</span>: <span class="hljs-string">"http://schema.org/"</span>,
  <span class="hljs-attr">"@id"</span>:  <span class="hljs-string">"document"</span>,
  <span class="hljs-attr">"b"</span>: {},
  <span class="hljs-attr">"a"</span>: {}
}
</pre>
<p>(<a href="http://tinyurl.com/ybj7k25f" rel="nofollow">example in playground</a>)</p>
<p>the returned document reverses the order of <code>b</code> and <code>a</code> (to be alphabetical), and not the order given in the frame.  Framing is a really elegant way to specify the nesting order, but it would be nice for framing to also be able to dictate the ordering, so that the output data file really follows the exact structure of the given frame.</p>
<p>Related issue: there is no way to indicate that referenced nodes should occur before they are references (excluding circular references), which can be useful in streaming files.  Having control of the node order via the frame would also give a mechanism to address that.</p>
<p>Hope this makes sense and apologies if I'm missing something fundamental here that makes alphabetizing the node order the only logical thing to do; or if I've misunderstood the expected behavior.</p></div>
  <div class="issue" id="issue-container-number-550"><div role="heading" class="issue-title marker" id="h-issue-1" aria-level="3"><a href="https://github.com/json-ld/json-ld.org/issues/550"><span>Issue 550</span></a><span style="text-transform: none">: Framing document does not render correct in Safari<a class="respec-gh-label respec-label-dark" href="https://github.com/json-ld/json-ld.org//issues/?q=is%3Aissue+is%3Aopen+label%3A%22framing%22" style="background-color: rgb(68, 68, 68);">framing</a><a class="respec-gh-label respec-label-dark" href="https://github.com/json-ld/json-ld.org//issues/?q=is%3Aissue+is%3Aopen+label%3A%22spec-editorial%22" style="background-color: rgb(225, 2, 216);">spec-editorial</a></span></div><p>The CSS/JS does not render in safari, with the error:<br>
<code>Cannot declare a const variable twice: 'e'.</code></p></div>
  <div class="issue" id="issue-container-number-579"><div role="heading" class="issue-title marker" id="h-issue-2" aria-level="3"><a href="https://github.com/json-ld/json-ld.org/issues/579"><span>Issue 579</span></a><span style="text-transform: none">: Frame Matching &amp; Blank Nodes<a class="respec-gh-label respec-label-dark" href="https://github.com/json-ld/json-ld.org//issues/?q=is%3Aissue+is%3Aopen+label%3A%22framing%22" style="background-color: rgb(68, 68, 68);">framing</a><a class="respec-gh-label respec-label-dark" href="https://github.com/json-ld/json-ld.org//issues/?q=is%3Aissue+is%3Aopen+label%3A%22spec-design%22" style="background-color: rgb(225, 12, 2);">spec-design</a></span></div><p>The current draft for JSON-LD framing (January 2018) does not mention blank nodes in the <a href="https://json-ld.org/spec/latest/json-ld-framing/#frame-matching" rel="nofollow">frame matching algorithm specification</a> and a strict interpretation of the first test goes a bit against the semantics of RDF in case a frame includes blank nodes:</p>
<blockquote>
<p><strong>1</strong> Node matches if it has an <code>@id</code> property value which is also a value of the <code>@id</code> property in frame.</p>
</blockquote>
<p>According to its definition, a frame is a JSON-LD document, meaning it can include blank nodes. if it happens, blank nodes in the frame will match blank nodes in a document only if they have the same ID and I believe that the <a href="https://github.com/ruby-rdf/json-ld/blob/develop/lib/json/ld/frame.rb#L293">Ruby implementation</a> performs simple string comparison.</p>
<p>In RDF, shared blank nodes require a <a href="https://www.w3.org/TR/rdf11-mt/#shared-blank-nodes-unions-and-merges" rel="nofollow">special handling</a> and we loose that specificity here. It would be good to either redefine JSON-LD frames such that blank nodes are not allowed or precise the specification of frame matching. I would be in favor of the latter approach.</p>
<p>Blank nodes in JSON-LD frames might be useful when nodes have multiple relations to each other. For instance, nodes matching the following frame represent all alumni of a university who still work for that university:</p>
<div class="highlight highlight-source-js"><pre aria-busy="false" class="hljs json">{
  <span class="hljs-attr">"@context"</span>: <span class="hljs-string">"http://schema.org"</span>,
  <span class="hljs-attr">"@type"</span>: <span class="hljs-string">"Person"</span>,
  <span class="hljs-attr">"alumniOf"</span>: {
    <span class="hljs-attr">"@id"</span>: <span class="hljs-string">"_:univ"</span>,
    <span class="hljs-attr">"@type"</span>: <span class="hljs-string">"CollegeOrUniversity"</span>
  },
  <span class="hljs-attr">"worksFor"</span>: { <span class="hljs-attr">"@id"</span>: <span class="hljs-string">"_:univ"</span> }
}</pre></div></div>
  <div class="issue" id="issue-container-number-588"><div role="heading" class="issue-title marker" id="h-issue-3" aria-level="3"><a href="https://github.com/json-ld/json-ld.org/issues/588"><span>Issue 588</span></a><span style="text-transform: none">: Framing and @reverse<a class="respec-gh-label respec-label-dark" href="https://github.com/json-ld/json-ld.org//issues/?q=is%3Aissue+is%3Aopen+label%3A%22framing%22" style="background-color: rgb(68, 68, 68);">framing</a><a class="respec-gh-label respec-label-light" href="https://github.com/json-ld/json-ld.org//issues/?q=is%3Aissue+is%3Aopen+label%3A%22question%22" style="background-color: rgb(199, 222, 248);">question</a></span></div><p>Further to <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="25641059" data-permission-text="Issue title is private" data-url="https://github.com/json-ld/json-ld.org/issues/311" href="https://github.com/json-ld/json-ld.org/issues/311">#311</a>, should the predicate that triggered the use of an <code>@reverse</code> property in a frame be removed from its resource to avoid a necessarily circular reference?</p>
<p>For example, if the data shape is:</p>
<p>X includes Y<br>
Z is Y<br>
Z in X</p>
<p>And there's a <a class="user-mention" data-hovercard-user-id="46798" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/reverse">@reverse</a> of "in" called "proxies" which is then <a class="user-mention" data-hovercard-user-id="107747" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/embed">@embed</a> always via a Frame, should the Z resources also have in back to X?</p>
<p>I would have expected:</p>
<pre aria-busy="false" class="hljs json">{
  <span class="hljs-attr">"id"</span>: <span class="hljs-string">"X"</span>,
  <span class="hljs-attr">"includes"</span>:  [<span class="hljs-string">"Y"</span>],
  <span class="hljs-attr">"uses"</span>: [{<span class="hljs-attr">"id"</span>: <span class="hljs-string">"Z"</span>, <span class="hljs-attr">"is"</span>: <span class="hljs-string">"Y"</span>}]
}
</pre>
<p>But instead the <code>in</code> property is still present in Z.</p>
<p>Use Case:  <a href="http://openarchives.org/ore/0.9/jsonld#proxies" rel="nofollow">http://openarchives.org/ore/0.9/jsonld#proxies</a></p></div>
</section>

<section class="appendix informative" id="acknowledgements">
<!--OddPage--><h2 id="f-acknowledgements"><span class="secno">F. </span>Acknowledgements&nbsp;<span class="permalink"><a href="#acknowledgements" aria-label="Permalink for F. Acknowledgements" title="Permalink for F. Acknowledgements"><span>§</span></a></span></h2><p><em>This section is non-normative.</em></p>

<p>A large amount of thanks goes out to the JSON-LD Community Group
participants who worked through many of the technical issues on the mailing
list and the weekly telecons - of special mention are Niklas Lindström,
François Daoust, and Zdenko 'Denny' Vrandečić.
The editors would like to thank Mark Birbeck, who provided a great deal of
the initial push behind the JSON-LD work via his work on RDFj.
The work of Dave Lehn and Mike Johnson are appreciated for reviewing,
and performing several implementations of the specification. Ian Davis is
thanked for this work on RDF/JSON. Thanks also to Nathan Rixham,
Bradley P. Allen,
Kingsley Idehen, Glenn McDonald, Alexandre Passant, Danny Ayers, Ted
Thibodeau Jr., Olivier Grisel, Josh Mandel, Eric Prud'hommeaux,
David Wood, Guus Schreiber, Pat Hayes, Sandro Hawke, and Richard
Cyganiak for their input on the specification.
</p></section>



<section id="references" class="appendix"><!--OddPage--><h2 id="g-references"><span class="secno">G. </span>References&nbsp;<span class="permalink"><a href="#references" aria-label="Permalink for G. References" title="Permalink for G. References"><span>§</span></a></span></h2><section id="normative-references"><h3 id="g-1-normative-references"><span class="secno">G.1 </span>Normative references&nbsp;<span class="permalink"><a href="#normative-references" aria-label="Permalink for G.1 Normative references" title="Permalink for G.1 Normative references"><span>§</span></a></span></h3><dl class="bibliography"><dt id="bib-BCP47">[BCP47]</dt><dd><a href="https://tools.ietf.org/html/bcp47"><cite>Tags for Identifying Languages</cite></a>. A. Phillips; M. Davis. IETF. September 2009. IETF Best Current Practice. URL: <a href="https://tools.ietf.org/html/bcp47">https://tools.ietf.org/html/bcp47</a>
</dd><dt id="bib-JSON-LD">[JSON-LD]</dt><dd><a href="https://www.w3.org/TR/json-ld/"><cite>JSON-LD 1.0</cite></a>. Manu Sporny; Gregg Kellogg; Markus Lanthaler. W3C. 16 January 2014. W3C Recommendation. URL: <a href="https://www.w3.org/TR/json-ld/">https://www.w3.org/TR/json-ld/</a>
</dd><dt id="bib-JSON-LD11CG">[JSON-LD11CG]</dt><dd><a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld/"><cite>JSON-LD 1.1</cite></a>. Gregg Kellogg. W3C. CG Final. URL: <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld/">https://www.w3.org/2018/jsonld-cg-reports/json-ld/</a>
</dd><dt id="bib-JSON-LD11CG-API">[JSON-LD11CG-API]</dt><dd><a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/"><cite>JSON-LD 1.1 Processing Algorithms and API</cite></a>. Gregg Kellogg. W3C. CG Final. URL: <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/">https://www.w3.org/2018/jsonld-cg-reports/json-ld-api/</a>
</dd><dt id="bib-RDF-CONCEPTS">[RDF-CONCEPTS]</dt><dd><a href="https://www.w3.org/TR/rdf-concepts/"><cite>Resource Description Framework (RDF): Concepts and Abstract Syntax</cite></a>. Graham Klyne; Jeremy Carroll. W3C. 10 February 2004. W3C Recommendation. URL: <a href="https://www.w3.org/TR/rdf-concepts/">https://www.w3.org/TR/rdf-concepts/</a>
</dd><dt id="bib-RFC2119">[RFC2119]</dt><dd><a href="https://tools.ietf.org/html/rfc2119"><cite>Key words for use in RFCs to Indicate Requirement Levels</cite></a>. S. Bradner. IETF. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
</dd><dt id="bib-RFC3987">[RFC3987]</dt><dd><a href="https://tools.ietf.org/html/rfc3987"><cite>Internationalized Resource Identifiers (IRIs)</cite></a>. M. Duerst; M. Suignard. IETF. January 2005. Proposed Standard. URL: <a href="https://tools.ietf.org/html/rfc3987">https://tools.ietf.org/html/rfc3987</a>
</dd><dt id="bib-RFC7159">[RFC7159]</dt><dd><a href="https://tools.ietf.org/html/rfc7159"><cite>The JavaScript Object Notation (JSON) Data Interchange Format</cite></a>. T. Bray, Ed.. IETF. March 2014. Proposed Standard. URL: <a href="https://tools.ietf.org/html/rfc7159">https://tools.ietf.org/html/rfc7159</a>
</dd><dt id="bib-WEBIDL">[WEBIDL]</dt><dd><a href="https://heycam.github.io/webidl/"><cite>Web IDL</cite></a>. Cameron McCormack; Boris Zbarsky; Tobie Langel. W3C. 15 December 2016. W3C Editor's Draft. URL: <a href="https://heycam.github.io/webidl/">https://heycam.github.io/webidl/</a>
</dd></dl></section><section id="informative-references"><h3 id="g-2-informative-references"><span class="secno">G.2 </span>Informative references&nbsp;<span class="permalink"><a href="#informative-references" aria-label="Permalink for G.2 Informative references" title="Permalink for G.2 Informative references"><span>§</span></a></span></h3><dl class="bibliography"><dt id="bib-ECMASCRIPT-6.0">[ECMASCRIPT-6.0]</dt><dd><a href="http://www.ecma-international.org/ecma-262/6.0/index.html"><cite>ECMA-262 6th Edition, The ECMAScript 2015 Language Specification</cite></a>. Allen Wirfs-Brock. Ecma International. June 2015. Standard. URL: <a href="http://www.ecma-international.org/ecma-262/6.0/index.html">http://www.ecma-international.org/ecma-262/6.0/index.html</a>
</dd><dt id="bib-JSON-LD-TESTS">[JSON-LD-TESTS]</dt><dd><a href="https://json-ld.org/test-suite/"><cite>JSON-LD 1.1 Test Suite</cite></a>. Gregg Kellogg. Linking Data in JSON Community Group. URL: <a href="https://json-ld.org/test-suite/">https://json-ld.org/test-suite/</a>
</dd><dt id="bib-JSON-LD11CG-FRAMING">[JSON-LD11CG-FRAMING]</dt><dd><a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-framing/"><cite>JSON-LD 1.1 Framing</cite></a>. Gregg Kellogg. W3C. CG Final. URL: <a href="https://www.w3.org/2018/jsonld-cg-reports/json-ld-framing/">https://www.w3.org/2018/jsonld-cg-reports/json-ld-framing/</a>
</dd><dt id="bib-RDF-SCHEMA">[RDF-SCHEMA]</dt><dd><a href="https://www.w3.org/TR/rdf-schema/"><cite>RDF Schema 1.1</cite></a>. Dan Brickley; Ramanathan Guha. W3C. 25 February 2014. W3C Recommendation. URL: <a href="https://www.w3.org/TR/rdf-schema/">https://www.w3.org/TR/rdf-schema/</a>
</dd><dt id="bib-RDF11-CONCEPTS">[RDF11-CONCEPTS]</dt><dd><a href="https://www.w3.org/TR/rdf11-concepts/"><cite>RDF 1.1 Concepts and Abstract Syntax</cite></a>. Richard Cyganiak; David Wood; Markus Lanthaler. W3C. 25 February 2014. W3C Recommendation. URL: <a href="https://www.w3.org/TR/rdf11-concepts/">https://www.w3.org/TR/rdf11-concepts/</a>
</dd></dl></section></section><p role="navigation" id="back-to-top"><a href="#title"><abbr title="Back to Top">↑</abbr></a></p><script src="https://www.w3.org/scripts/TR/2016/fixup.js"></script></body></html>
